Created
August 29, 2012 23:58
-
-
Save grantr/3520657 to your computer and use it in GitHub Desktop.
Reel chunked-encoding bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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