From: Yura Kloubakov Date: 2005-05-12T08:51:19+09:00 Subject: Fix for the Webrick "Errno::EINVAL: Invalid argument" error 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.