typhoeus 0.1.28 → 0.1.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ In-Progress
2
+ -----------
3
+
4
+ 0.1.29
5
+ ------
6
+ * Fixed a memory corruption with using CURLOPT_POSTFIELDS [gravis,
7
+ 32531d0821aecc4]
8
+
1
9
  0.1.28
2
10
  ----------------
3
11
  * Added SSL cert options for Typhoeus::Easy [GH-25, gravis]
@@ -103,8 +103,8 @@ hydra.queue first_request
103
103
  hydra.queue second_request
104
104
  hydra.run # this is a blocking call that returns once all requests are complete
105
105
 
106
- first_request.handled_resposne # the value returned from the on_complete block
107
- second_request.handled_resposne # the value returned from the on_complete block (parsed JSON)
106
+ first_request.handled_response # the value returned from the on_complete block
107
+ second_request.handled_response # the value returned from the on_complete block (parsed JSON)
108
108
  </pre>
109
109
 
110
110
  The execution of that code goes something like this. The first and second requests are built and queued. When hydra is run the first and second requests run in parallel. When the first request completes, the third request is then built and queued up. The moment it is queued Hydra starts executing it. Meanwhile the second request would continue to run (or it could have completed before the first). Once the third request is done, hydra.run returns.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.28
1
+ 0.1.29
@@ -12,6 +12,7 @@ module Typhoeus
12
12
  :CURLOPT_UPLOAD => 46,
13
13
  :CURLOPT_CUSTOMREQUEST => 10036,
14
14
  :CURLOPT_POSTFIELDS => 10015,
15
+ :CURLOPT_COPYPOSTFIELDS => 10165,
15
16
  :CURLOPT_POSTFIELDSIZE => 60,
16
17
  :CURLOPT_USERAGENT => 10018,
17
18
  :CURLOPT_TIMEOUT_MS => 155,
@@ -50,7 +51,6 @@ module Typhoeus
50
51
 
51
52
  def initialize
52
53
  @method = :get
53
- @post_dat_set = nil
54
54
  @headers = {}
55
55
 
56
56
  set_option(OPTION_VALUES[:CURLOPT_ENCODING], 'zlib') if supports_zlib?
@@ -158,8 +158,8 @@ module Typhoeus
158
158
 
159
159
  def post_data=(data)
160
160
  @post_data_set = true
161
- set_option(OPTION_VALUES[:CURLOPT_POSTFIELDS], data)
162
161
  set_option(OPTION_VALUES[:CURLOPT_POSTFIELDSIZE], data.length)
162
+ set_option(OPTION_VALUES[:CURLOPT_COPYPOSTFIELDS], data)
163
163
  end
164
164
 
165
165
  def params=(params)
@@ -149,6 +149,7 @@ module Typhoeus
149
149
  easy.ssl_key_password = request.ssl_key_password
150
150
  easy.ssl_cacert = request.ssl_cacert
151
151
  easy.ssl_capath = request.ssl_capath
152
+ easy.verbose = request.verbose
152
153
 
153
154
  easy.on_success do |easy|
154
155
  queue_next
@@ -11,7 +11,7 @@ module Typhoeus
11
11
  end
12
12
 
13
13
  def add(easy)
14
- easy.set_headers()
14
+ easy.set_headers() if easy.headers.empty?
15
15
  @easy_handles << easy
16
16
  multi_add_handle(easy)
17
17
  end
@@ -1,6 +1,6 @@
1
1
  module Typhoeus
2
2
  class Request
3
- attr_accessor :method, :params, :body, :headers, :timeout, :user_agent, :response, :cache_timeout, :follow_location, :max_redirects, :proxy, :disable_ssl_peer_verification, :ssl_cert, :ssl_cert_type, :ssl_key, :ssl_key_type, :ssl_key_password, :ssl_cacert, :ssl_capath
3
+ attr_accessor :method, :params, :body, :headers, :timeout, :user_agent, :response, :cache_timeout, :follow_location, :max_redirects, :proxy, :disable_ssl_peer_verification, :ssl_cert, :ssl_cert_type, :ssl_key, :ssl_key_type, :ssl_key_password, :ssl_cacert, :ssl_capath, :verbose
4
4
 
5
5
 
6
6
  attr_reader :url
@@ -28,6 +28,7 @@ module Typhoeus
28
28
  # ** +:ssl_key_password
29
29
  # ** +:ssl_cacert
30
30
  # ** +:ssl_capath
31
+ # ** +:verbose
31
32
  #
32
33
  def initialize(url, options = {})
33
34
  @method = options[:method] || :get
@@ -48,6 +49,7 @@ module Typhoeus
48
49
  @ssl_key_password = options[:ssl_key_password]
49
50
  @ssl_cacert = options[:ssl_cacert]
50
51
  @ssl_capath = options[:ssl_capath]
52
+ @verbose = options[:verbose]
51
53
 
52
54
  if @method == :post
53
55
  @url = url
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{typhoeus}
8
- s.version = "0.1.28"
8
+ s.version = "0.1.29"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Dix"]
12
- s.date = %q{2010-06-29}
12
+ s.date = %q{2010-07-05}
13
13
  s.description = %q{Like a modern code version of the mythical beast with 100 serpent heads, Typhoeus runs HTTP requests in parallel while cleanly encapsulating handling logic.}
14
14
  s.email = %q{paul@pauldix.net}
15
15
  s.extensions = ["ext/typhoeus/extconf.rb"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 28
9
- version: 0.1.28
8
+ - 29
9
+ version: 0.1.29
10
10
  platform: ruby
11
11
  authors:
12
12
  - Paul Dix
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-29 00:00:00 -07:00
17
+ date: 2010-07-05 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency