[openssl-users] BIO_read hangs, how can I know if the server wants to send data?

Michael Wojcik Michael.Wojcik at microfocus.com
Tue Apr 26 16:58:48 UTC 2016


> From: Michael Wojcik
> Sent: Tuesday, April 26, 2016 12:39
> To: openssl-users at openssl.org
> Subject: RE: [openssl-users] BIO_read hangs, how can I know if the server
> wants to send data?
> 
> Ugh. Apache is doing the Wrong Thing. It's sending data as it generates it,
> instead of coalescing. Those two-octet messages are almost certainly the CR
> LF pairs that terminate lines of the HTTP header.

Rainer Jung has pointed out this is may well be a chunked message body. I was thinking we were still looking at the HTTP header here.

If it's a chunked message body, that's more understandable, but it's still the wrong thing for Apache to be doing. With TCP you always, always, always want to present all the associated outbound data to the stack at once, to avoid the overhead of sending small packets and Nagle / Delayed ACK. It appears that Apache is writing the chunk header and then the chunk data, which is precisely what it should NOT do.

Though actually that said I don't think this is chunked TE, because the chunk header must be at least 3 octets: at least one hex digit, CR, and LF.

But, again, this is just a performance and efficiency hit - it won't break anything - and if it's on the Apache side, there probably isn't much you can do about it. Maybe it's tunable in the Apache configuration but it seems like an odd thing to make configurable, and even odder to make wrong by default.

-- 
Michael Wojcik
Technology Specialist, Micro Focus




More information about the openssl-users mailing list