lib/kcar/response.rb in kcar-0.1.1 vs lib/kcar/response.rb in kcar-0.1.2
- old
+ new
@@ -60,10 +60,12 @@
# this method allows our Kcar::Response object to be used as a Rack response
# body. It may only be called once (usually by a Rack server) as it streams
# the response body off the our socket object.
def each(&block)
- return if parser.body_eof?
+ if parser.body_eof?
+ return
+ end
if unchunk
parser.chunked? ? each_unchunk(&block) : each_identity(&block)
else
if parser.keepalive?
parser.chunked? ? each_rechunk(&block) : each_identity(&block)