lib/net/http/pipeline.rb in net-http-pipeline-0.0 vs lib/net/http/pipeline.rb in net-http-pipeline-0.1
- old
+ new
@@ -22,11 +22,11 @@
# end
# end
module Net::HTTP::Pipeline
- VERSION = '0.0'
+ VERSION = '0.1'
##
# Pipeline error class
class Error < RuntimeError
@@ -81,14 +81,20 @@
D 'Conn close on pipeline'
@socket.close
end
end
- ##
- # Checks for an connection close header
+ if Net::HTTPResponse.allocate.respond_to? :connection_close? then
+ ##
+ # Checks for an connection close header
- def pipeline_keep_alive? res
- not res.connection_close?
+ def pipeline_keep_alive? res
+ not res.connection_close?
+ end
+ else
+ def pipeline_keep_alive? res
+ not /close/i =~ res['connection'].to_s
+ end
end
end
class Net::HTTP