Skip to content

Instantly share code, notes, and snippets.

@GUI
Created March 9, 2011 20:22
Show Gist options
  • Save GUI/862918 to your computer and use it in GitHub Desktop.
Save GUI/862918 to your computer and use it in GitHub Desktop.
Multiple Typhoeus::Request PUT requests hang. Multiple Typhoeus::Easy PUT requests work.
require "typhoeus"
2.times do |i|
puts "\n==== RUN #{i} ===="
e = Typhoeus::Easy.new
e.url = "http://example.com/"
e.method = :put
e.verbose = true
e.perform
end
# $ ruby -rubygems typhoeus_put_easy.rb
#
# ==== RUN 0 ====
# * About to connect() to example.com port 80 (#0)
# * Trying 2620:0:2d0:200::10... * Failed to connect to 2620:0:2d0:200::10: No route to host
# * Undefined error: 0
# * Trying 192.0.32.10... * connected
# * Connected to example.com (192.0.32.10) port 80 (#0)
# > PUT / HTTP/1.1
# Host: example.com
# Accept: */*
# Accept-Encoding: deflate, gzip
# Content-Length: 0
#
# < HTTP/1.1 302 Found
# < Location: http://www.iana.org/domains/example/
# < Server: BigIP
# < Date: Wed, 09 Mar 2011 20:09:44 GMT
# < Content-Length: 0
# < Age: 0
# < Via: 1.0 localhost.localdomain
# <
# * Connection #0 to host example.com left intact
#
# ==== RUN 1 ====
# * About to connect() to example.com port 80 (#0)
# * Trying 2620:0:2d0:200::10... * Failed to connect to 2620:0:2d0:200::10: No route to host
# * Undefined error: 0
# * Trying 192.0.32.10... * connected
# * Connected to example.com (192.0.32.10) port 80 (#0)
# > PUT / HTTP/1.1
# Host: example.com
# Accept: */*
# Accept-Encoding: deflate, gzip
# Content-Length: 0
#
# < HTTP/1.1 302 Found
# < Location: http://www.iana.org/domains/example/
# < Server: BigIP
# < Date: Wed, 09 Mar 2011 20:09:44 GMT
# < Content-Length: 0
# < Age: 0
# < Via: 1.0 localhost.localdomain
# <
# * Connection #0 to host example.com left intact
# * Closing connection #0
# * Closing connection #0
require "typhoeus"
2.times do |i|
puts "\n==== RUN #{i} ===="
Typhoeus::Request.run("http://example.com/", :method => :put, :verbose => true)
end
# $ ruby -rubygems typhoeus_put_request.rb
#
# ==== RUN 0 ====
# * About to connect() to example.com port 80 (#0)
# * Trying 2620:0:2d0:200::10... * Failed to connect to 2620:0:2d0:200::10: No route to host
# * Undefined error: 0
# * Trying 192.0.32.10... * 0x100937c00 is at send pipe head!
# * Connected to example.com (192.0.32.10) port 80 (#0)
# > PUT / HTTP/1.1
# Host: example.com
# Accept: */*
# Accept-Encoding: deflate, gzip
# User-Agent: Typhoeus - http://github.com/dbalatero/typhoeus/tree/master
# Content-Length: 0
# Expect: 100-continue
#
# < HTTP/1.1 302 Found
# < Location: http://www.iana.org/domains/example/
# < Server: BigIP
# < Date: Wed, 09 Mar 2011 20:07:04 GMT
# < Content-Length: 0
# < Age: 0
# < Via: 1.0 localhost.localdomain
# <
# * Connection #0 to host example.com left intact
#
# ==== RUN 1 ====
# * Re-using existing connection! (#0) with host example.com
# * Connected to example.com (192.0.32.10) port 80 (#0)
# * 0x100937c00 is at send pipe head!
# > PUT / HTTP/1.1
# Host: example.com
# Accept: */*
# Transfer-Encoding: chunked
# User-Agent: Typhoeus - http://github.com/dbalatero/typhoeus/tree/master
# Expect: 100-continue
#
# * Done waiting for 100-continue
# ^C* Closing connection #0
# /opt/local/lib/ruby/gems/1.8/gems/typhoeus-0.2.4/lib/typhoeus/multi.rb:21:in `multi_perform': Interrupt
# from /opt/local/lib/ruby/gems/1.8/gems/typhoeus-0.2.4/lib/typhoeus/multi.rb:21:in `perform'
# from /opt/local/lib/ruby/gems/1.8/gems/typhoeus-0.2.4/lib/typhoeus/hydra.rb:95:in `run'
# from /opt/local/lib/ruby/gems/1.8/gems/typhoeus-0.2.4/lib/typhoeus/request.rb:177:in `run'
# from typhoeus_put_request.rb:5
# from typhoeus_put_request.rb:3:in `times'
# from typhoeus_put_request.rb:3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment