Kloubakov, Yura
5/11/2005 11:51:00 PM
It turns out that the problem is with the following HTTPServer#run code:
while timeout > 0
break if IO.select([sock], nil, nil, 0.5)
timeout = 0 if @status != :Running
timeout -= 0.5
end
raise HTTPStatus::EOFError if timeout <= 0
req.parse(sock)
where parse(sock) throws StandardError exception.
It happens because IO.select returns [[sock], [], []] while client has
closed its side of the connection. The fix can be as simple as adding
test for the sock.eof to the raise statement:
raise HTTPStatus::EOFError if timeout <= 0 || sock.eof?
Or may be it should be:
break if timeout <= 0 || sock.eof?
Regards,
Yura.