-
Notifications
You must be signed in to change notification settings - Fork 825
Closed
Description
👋
Since commit 992ba47, the following script hangs until the other side closes the connection:
server = TCPServer.new 9292
while session = server.accept
puts "Request"
while line = session.readline("\r\n")
puts line.inspect
break if line == "\r\n"
end
puts "Response"
session.write "HTTP/1.1 200 OK\r\n\r\nOK\n"
session.flush
session.close
endWith mruby-io and mruby-socket core mrbgems compiled in, running the above script and then e.g. curl 'http://localhost:9292/' outputs:
Before 992ba47:
Request
"GET / HTTP/1.1\r\n"
"Host: localhost:9292\r\n"
"User-Agent: curl/7.58.0\r\n"
"Accept: */*\r\n"
"\r\n"
Response
After:
Request
"GET / HTTP/1.1\r\n"
"Host: localhost:9292\r\n"
"User-Agent: curl/7.58.0\r\n"
"Accept: */*\r\n"
...
Same happens while calling session.getc in the inner loop. Is this expected behavior? It also doesn't happen with MRI Ruby.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels