ethon 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +9 -0
- data/lib/ethon/easy/options.rb +39 -5
- data/lib/ethon/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,14 @@
|
|
4
4
|
|
5
5
|
[Full Changelog](http://github.com/typhoeus/ethon/compare/v0.5.8...master)
|
6
6
|
|
7
|
+
## 0.5.9
|
8
|
+
|
9
|
+
[Full Changelog](http://github.com/typhoeus/ethon/compare/v0.5.8...v0.5.9)
|
10
|
+
|
11
|
+
Enhancements:
|
12
|
+
|
13
|
+
* Allow to set multiple protocols.
|
14
|
+
|
7
15
|
## 0.5.8
|
8
16
|
|
9
17
|
[Full Changelog](http://github.com/typhoeus/ethon/compare/v0.5.7...v0.5.8)
|
@@ -12,6 +20,7 @@ Enhancements:
|
|
12
20
|
|
13
21
|
* Add support for protocols and redir_protocols(
|
14
22
|
[libcurl SASL buffer overflow vulnerability](http://curl.haxx.se/docs/adv_20130206.html)).
|
23
|
+
* Add max_send_speed_large and max_recv_speed_large([Paul Schuegraf](https://github.com/pschuegr), [\#33](https://github.com/typhoeus/ethon/pull/33))
|
15
24
|
|
16
25
|
## 0.5.7
|
17
26
|
|
data/lib/ethon/easy/options.rb
CHANGED
@@ -384,6 +384,38 @@ module Ethon
|
|
384
384
|
Curl.set_option(:maxredirs, value_for(value, :int), handle)
|
385
385
|
end
|
386
386
|
|
387
|
+
# Pass a curl_off_t as parameter. If an upload exceeds this speed
|
388
|
+
# (counted in bytes per second) on cumulative average during the
|
389
|
+
# transfer, the transfer will pause to keep the average rate less than or
|
390
|
+
# equal to the parameter value. Defaults to unlimited speed. (Added in
|
391
|
+
# 7.15.5)
|
392
|
+
#
|
393
|
+
# @example Set max_send_speed_large option.
|
394
|
+
# easy.max_send_speed_large = 1
|
395
|
+
#
|
396
|
+
# @param [ Integer ] value The value to set.
|
397
|
+
#
|
398
|
+
# @return [ void ]
|
399
|
+
def max_send_speed_large=(value)
|
400
|
+
Curl.set_option(:max_send_speed_large, value_for(value, :int), handle)
|
401
|
+
end
|
402
|
+
|
403
|
+
# Pass a curl_off_t as parameter. If a download exceeds this speed
|
404
|
+
# (counted in bytes per second) on cumulative average during the
|
405
|
+
# transfer, the transfer will pause to keep the average rate less than or
|
406
|
+
# equal to the parameter value. Defaults to unlimited speed. (Added in
|
407
|
+
# 7.15.5)
|
408
|
+
#
|
409
|
+
# @example Set max_recv_speed_large option.
|
410
|
+
# easy.max_recv_speed_large = 1
|
411
|
+
#
|
412
|
+
# @param [ Integer ] value The value to set.
|
413
|
+
#
|
414
|
+
# @return [ void ]
|
415
|
+
def max_recv_speed_large=(value)
|
416
|
+
Curl.set_option(:max_recv_speed_large, value_for(value, :int), handle)
|
417
|
+
end
|
418
|
+
|
387
419
|
# A parameter set to 1 tells the library to not include the body-part
|
388
420
|
# in the output. This is only relevant for protocols that have separate
|
389
421
|
# header and body parts. On HTTP(S) servers, this will make libcurl do
|
@@ -456,7 +488,7 @@ module Ethon
|
|
456
488
|
# @example Set protocols option.
|
457
489
|
# easy.protocols = :http
|
458
490
|
#
|
459
|
-
# @param [ Symbol ] value The value to set.
|
491
|
+
# @param [ Symbol ] value The value or array of values to set.
|
460
492
|
#
|
461
493
|
# @return [ void ]
|
462
494
|
def protocols=(value)
|
@@ -475,7 +507,7 @@ module Ethon
|
|
475
507
|
# @example Set redir_protocols option.
|
476
508
|
# easy.redir_protocols = :http
|
477
509
|
#
|
478
|
-
# @param [ Symbol ] value The value to set.
|
510
|
+
# @param [ Symbol ] value The value or array of values to set.
|
479
511
|
#
|
480
512
|
# @return [ void ]
|
481
513
|
def redir_protocols=(value)
|
@@ -1106,9 +1138,11 @@ module Ethon
|
|
1106
1138
|
raise Errors::InvalidValue.new(option, value)
|
1107
1139
|
end
|
1108
1140
|
elsif type == :enum && (option == :protocols || option == :redir_protocols)
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1141
|
+
Array(value).map do |v|
|
1142
|
+
Curl::Protocols.to_h.fetch(v) do
|
1143
|
+
raise Errors::InvalidValue.new(option, v)
|
1144
|
+
end
|
1145
|
+
end.inject(:+)
|
1112
1146
|
elsif type == :enum && option == :proxytype
|
1113
1147
|
Curl::Proxy.to_h.fetch(value) do
|
1114
1148
|
raise Errors::InvalidValue.new(option, value)
|
data/lib/ethon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ethon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
segments:
|
126
126
|
- 0
|
127
|
-
hash:
|
127
|
+
hash: 1438762772824718681
|
128
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
129
|
none: false
|
130
130
|
requirements:
|