Skip to content

Instantly share code, notes, and snippets.

@grantr
Created August 29, 2012 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grantr/3520657 to your computer and use it in GitHub Desktop.
Save grantr/3520657 to your computer and use it in GitHub Desktop.
Reel chunked-encoding bug
require 'reel'
connections = []
server = Reel::Server.supervise '0.0.0.0', 3012 do |connection|
if request = connection.request
connections << connection
connection.respond :ok, transfer_encoding: :chunked
end
end
while true
sleep 1
connections.each do |conn|
begin
conn << "hello"
rescue IOError
puts "closed connection"
connections.delete(conn)
end
end
end
# curl --trace - http://127.0.0.1:3012/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment