ptls_t is an incomplete struct; add ptls_get_data and quicly_get_data

This commit is contained in:
Christian Ulrich 2020-11-09 09:58:17 +01:00
parent de780656f0
commit 8441c02a57
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
2 changed files with 8 additions and 1 deletions

View File

@ -60,7 +60,7 @@ type
VerifySignCb* = proc(verify_ctx: pointer, data: ptls_iovec_t,
sign: ptls_iovec_t): cint {.cdecl.}
ptls_t* {.importc, header: "picotls.h", bycopy.} = object
ptls_t* {.importc, header: "picotls.h", incompleteStruct.} = object
ptls_key_exchange_algorithm_t* {.importc, header: "picotls.h", bycopy.} = object
id*: uint16
@ -282,3 +282,6 @@ proc ptls_iovec_init*(p: pointer, len: csize_t): ptls_iovec_t {.importc, header:
proc ptls_load_certificates*(ctx: ptr ptls_context_t, cert_pem_file: cstring):
cint {.importc, header: "picotls.h", cdecl.}
proc ptls_get_data_ptr*(tls: ptr ptls_t): ptr pointer
{.importc, header: "picotls.h", cdecl.}

View File

@ -16,6 +16,7 @@ from constants import
quicly_stream_t
from ../picotls/picotls import
ptls_t,
ptls_aead_algorithm_t,
ptls_aead_context_t,
ptls_buffer_t,
@ -249,3 +250,6 @@ proc quicly_get_socklen*(sa: ptr SockAddr | ptr Sockaddr_storage): SockLen
proc quicly_get_first_timeout*(conn: ptr quicly_conn_t): int64
{.importc, header: "quicly.h", cdecl.}
proc quicly_get_data*(conn: ptr quicly_conn_t): ptr pointer
{.importc, header: "quicly.h", cdecl.}