sustrik / libdill

Structured concurrency in C
MIT License
1.68k stars 156 forks source link

TLS write failing : "Assert failed: rc == -1 (tls.c:383)" #161

Closed jadeblaquiere closed 5 years ago

jadeblaquiere commented 5 years ago

I'm hitting this assert using the provided example tutorial/sockets/step4.c when querying a REST API...

Here's what's happening: following the http_done() call the iolist passed to dill_tls_bsendl includes an entry with zero length.

According to "man SSL_write" the behavior of SSL_write is undefined for a zero length write. This seems to result in errno=SSL_ERROR_SYSCALL.

jadeblaquiere commented 5 years ago

fix merged