Skip to content

Commit 09f5021

Browse files
committed
Better HTTP/1 state handling.
1 parent ad437a7 commit 09f5021

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/async/http/protocol/http1/server.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ def fail_request(status)
3838
end
3939

4040
def next_request
41-
# Wait for the connection to become idle before reading the next request:
42-
unless idle?
41+
if closed?
42+
return nil
43+
elsif !idle?
4344
@ready.wait
4445
end
4546

46-
# The default is true.
47-
return unless @persistent
48-
4947
# Read an incoming request:
5048
return unless request = Request.read(self)
5149

0 commit comments

Comments
 (0)