On Thu, Mar 02, 2017 at 06:08:45PM -0300, Gleydson Soares wrote: > Yes, it's using libtls and evbuffer_tls(came from syslogd).
I have copied it from libevent and adapted it to tls. > I did some tests and I think this hangs with jpeg >=4k and <=15k, > other image sizes not triggers the issue. > ..weird libevent uses 4k read blocks and libssl 16k blocks internally. This is at least inefficent and I guess could lead to hangs. Could you test this diff? bluhm Index: usr.sbin/ldapd/evbuffer_tls.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/ldapd/evbuffer_tls.c,v retrieving revision 1.1 diff -u -p -r1.1 evbuffer_tls.c --- usr.sbin/ldapd/evbuffer_tls.c 1 May 2016 00:32:37 -0000 1.1 +++ usr.sbin/ldapd/evbuffer_tls.c 2 Mar 2017 21:36:35 -0000 @@ -289,7 +289,7 @@ buffertls_connect(struct buffertls *buft * Reads data from a file descriptor into a buffer. */ -#define EVBUFFER_MAX_READ 4096 +#define EVBUFFER_MAX_READ 16384 int evtls_read(struct evbuffer *buf, int fd, int howmuch, struct tls *ctx)
