Subject: | IO::Socket::SSL and HTTP::Daemon's select-sysread loop don't work well together |
The below bug raised for HTTP::Daemon::SSL is actually a bug in the
base HTTP::Daemon. You can rewrite the test server in the Perlmonks
node using only HTTP::Daemon and the result is the same.
HTTP::Daemon::SSL hangs on largish (e.g. >37k or >67k) POST request.
Quoting zwon on perlmonks.org:
"It looks like select-sysread loop in HTTP::Daemon doesn't work
correctly with IO::Socket::SSL. That's because select in _need_more
tests real filehandle and sysread reads from IO::Socket::SSL object
which is buffered, so
sysread($self, $_[0], 2048, length($_[0]))
may actually read more than 2048 bytes from the socket and
subsequent
select on socket will hang.
Removing Timeout [which avoids the select() altogether] as proposed by
derby solves the problem."
Complete description in: http://www.perlmonks.org/?node_id=761270