I believe that 5 isn’t enough hellos to fill up a chunk. Changing
this to loop do … end causes webrick to give you infinite hellos.
Looking at the webrick’s code in httpresponse.rb
261 while buf = @body.read(BUFSIZE)
262 next if buf.empty?
263 data = “”
264 data << format("%x", buf.size) << CRLF
265 data << buf << CRLF
The servlet reaches line 261 immediately but hangs for 5 seconds
before getting to line 262. If the IO.pipe only has a bit of data in
it, it seems like @body.read(BUFSIZE) should only return what is in
there and not wait for BUFSIZE.
Is there a way to avoid this behavior?
Thanks,
ry
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.