ethon 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +41 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +5 -0
- data/Guardfile +1 -0
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/ethon.gemspec +2 -1
- data/lib/ethon.rb +1 -0
- data/lib/ethon/curl.rb +1 -0
- data/lib/ethon/curls/classes.rb +1 -0
- data/lib/ethon/curls/codes.rb +1 -1
- data/lib/ethon/curls/constants.rb +1 -0
- data/lib/ethon/curls/form_options.rb +1 -0
- data/lib/ethon/curls/functions.rb +4 -13
- data/lib/ethon/curls/infos.rb +4 -3
- data/lib/ethon/curls/messages.rb +1 -0
- data/lib/ethon/curls/options.rb +25 -22
- data/lib/ethon/curls/settings.rb +1 -0
- data/lib/ethon/easy.rb +1 -1
- data/lib/ethon/easy/callbacks.rb +4 -3
- data/lib/ethon/easy/debug_info.rb +1 -0
- data/lib/ethon/easy/features.rb +1 -0
- data/lib/ethon/easy/form.rb +1 -0
- data/lib/ethon/easy/header.rb +1 -0
- data/lib/ethon/easy/http.rb +1 -0
- data/lib/ethon/easy/http/actionable.rb +1 -0
- data/lib/ethon/easy/http/custom.rb +1 -0
- data/lib/ethon/easy/http/delete.rb +1 -0
- data/lib/ethon/easy/http/get.rb +1 -0
- data/lib/ethon/easy/http/head.rb +1 -0
- data/lib/ethon/easy/http/options.rb +1 -0
- data/lib/ethon/easy/http/patch.rb +1 -0
- data/lib/ethon/easy/http/post.rb +1 -0
- data/lib/ethon/easy/http/postable.rb +1 -0
- data/lib/ethon/easy/http/put.rb +1 -0
- data/lib/ethon/easy/http/putable.rb +1 -0
- data/lib/ethon/easy/informations.rb +1 -0
- data/lib/ethon/easy/mirror.rb +1 -0
- data/lib/ethon/easy/operations.rb +16 -1
- data/lib/ethon/easy/options.rb +1 -0
- data/lib/ethon/easy/params.rb +1 -0
- data/lib/ethon/easy/queryable.rb +1 -0
- data/lib/ethon/easy/response_callbacks.rb +1 -0
- data/lib/ethon/easy/util.rb +1 -0
- data/lib/ethon/errors.rb +1 -0
- data/lib/ethon/errors/ethon_error.rb +1 -0
- data/lib/ethon/errors/global_init.rb +1 -0
- data/lib/ethon/errors/invalid_option.rb +1 -0
- data/lib/ethon/errors/invalid_value.rb +1 -0
- data/lib/ethon/errors/multi_add.rb +1 -0
- data/lib/ethon/errors/multi_fdset.rb +1 -0
- data/lib/ethon/errors/multi_remove.rb +1 -0
- data/lib/ethon/errors/multi_timeout.rb +1 -0
- data/lib/ethon/errors/select.rb +1 -0
- data/lib/ethon/libc.rb +1 -0
- data/lib/ethon/loggable.rb +1 -0
- data/lib/ethon/multi.rb +1 -0
- data/lib/ethon/multi/operations.rb +1 -0
- data/lib/ethon/multi/options.rb +8 -7
- data/lib/ethon/multi/stack.rb +1 -0
- data/lib/ethon/version.rb +2 -1
- data/profile/benchmarks.rb +1 -0
- data/profile/memory_leaks.rb +1 -0
- data/profile/perf_spec_helper.rb +1 -0
- data/profile/support/memory_test_helpers.rb +1 -0
- data/profile/support/os_memory_leak_tracker.rb +1 -0
- data/profile/support/ruby_object_leak_tracker.rb +1 -0
- data/spec/ethon/curl_spec.rb +1 -0
- data/spec/ethon/easy/callbacks_spec.rb +1 -0
- data/spec/ethon/easy/debug_info_spec.rb +1 -0
- data/spec/ethon/easy/features_spec.rb +1 -0
- data/spec/ethon/easy/form_spec.rb +1 -0
- data/spec/ethon/easy/header_spec.rb +1 -0
- data/spec/ethon/easy/http/custom_spec.rb +1 -0
- data/spec/ethon/easy/http/delete_spec.rb +1 -0
- data/spec/ethon/easy/http/get_spec.rb +1 -0
- data/spec/ethon/easy/http/head_spec.rb +1 -0
- data/spec/ethon/easy/http/options_spec.rb +1 -0
- data/spec/ethon/easy/http/patch_spec.rb +1 -0
- data/spec/ethon/easy/http/post_spec.rb +1 -0
- data/spec/ethon/easy/http/put_spec.rb +1 -0
- data/spec/ethon/easy/http_spec.rb +1 -0
- data/spec/ethon/easy/informations_spec.rb +1 -0
- data/spec/ethon/easy/mirror_spec.rb +1 -0
- data/spec/ethon/easy/operations_spec.rb +1 -0
- data/spec/ethon/easy/options_spec.rb +2 -1
- data/spec/ethon/easy/queryable_spec.rb +1 -0
- data/spec/ethon/easy/response_callbacks_spec.rb +1 -0
- data/spec/ethon/easy/util_spec.rb +1 -0
- data/spec/ethon/easy_spec.rb +3 -2
- data/spec/ethon/libc_spec.rb +1 -0
- data/spec/ethon/loggable_spec.rb +1 -0
- data/spec/ethon/multi/operations_spec.rb +1 -0
- data/spec/ethon/multi/options_spec.rb +1 -0
- data/spec/ethon/multi/stack_spec.rb +1 -0
- data/spec/ethon/multi_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/localhost_server.rb +2 -1
- data/spec/support/server.rb +1 -0
- metadata +6 -7
- data/.travis.yml +0 -30
data/lib/ethon/easy/header.rb
CHANGED
data/lib/ethon/easy/http.rb
CHANGED
data/lib/ethon/easy/http/get.rb
CHANGED
data/lib/ethon/easy/http/head.rb
CHANGED
data/lib/ethon/easy/http/post.rb
CHANGED
data/lib/ethon/easy/http/put.rb
CHANGED
data/lib/ethon/easy/mirror.rb
CHANGED
@@ -1,8 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Ethon
|
2
3
|
class Easy
|
3
4
|
# This module contains the logic to prepare and perform
|
4
5
|
# an easy.
|
5
6
|
module Operations
|
7
|
+
|
8
|
+
class PointerHelper
|
9
|
+
class<<self
|
10
|
+
def synchronize( &block )
|
11
|
+
(@mutex ||= Mutex.new).synchronize( &block )
|
12
|
+
end
|
13
|
+
|
14
|
+
def release( pointer )
|
15
|
+
synchronize { Curl.easy_cleanup pointer }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
synchronize{}
|
19
|
+
end
|
20
|
+
|
6
21
|
# Returns a pointer to the curl easy handle.
|
7
22
|
#
|
8
23
|
# @example Return the handle.
|
@@ -10,7 +25,7 @@ module Ethon
|
|
10
25
|
#
|
11
26
|
# @return [ FFI::Pointer ] A pointer to the curl easy handle.
|
12
27
|
def handle
|
13
|
-
@handle ||= FFI::AutoPointer.new(Curl.easy_init,
|
28
|
+
@handle ||= FFI::AutoPointer.new(Curl.easy_init, PointerHelper.method(:release) )
|
14
29
|
end
|
15
30
|
|
16
31
|
# Sets a pointer to the curl easy handle.
|
data/lib/ethon/easy/options.rb
CHANGED
data/lib/ethon/easy/params.rb
CHANGED
data/lib/ethon/easy/queryable.rb
CHANGED
data/lib/ethon/easy/util.rb
CHANGED
data/lib/ethon/errors.rb
CHANGED
data/lib/ethon/errors/select.rb
CHANGED
data/lib/ethon/libc.rb
CHANGED
data/lib/ethon/loggable.rb
CHANGED
data/lib/ethon/multi.rb
CHANGED
data/lib/ethon/multi/options.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Ethon
|
2
3
|
class Multi
|
3
4
|
|
@@ -8,7 +9,7 @@ module Ethon
|
|
8
9
|
# Sets max_total_connections option.
|
9
10
|
#
|
10
11
|
# @example Set max_total_connections option.
|
11
|
-
#
|
12
|
+
# multi.max_total_conections = $value
|
12
13
|
#
|
13
14
|
# @param [ String ] value The value to set.
|
14
15
|
#
|
@@ -20,7 +21,7 @@ module Ethon
|
|
20
21
|
# Sets maxconnects option.
|
21
22
|
#
|
22
23
|
# @example Set maxconnects option.
|
23
|
-
#
|
24
|
+
# multi.maxconnects = $value
|
24
25
|
#
|
25
26
|
# @param [ String ] value The value to set.
|
26
27
|
#
|
@@ -32,7 +33,7 @@ module Ethon
|
|
32
33
|
# Sets pipelining option.
|
33
34
|
#
|
34
35
|
# @example Set pipelining option.
|
35
|
-
#
|
36
|
+
# multi.pipelining = $value
|
36
37
|
#
|
37
38
|
# @param [ String ] value The value to set.
|
38
39
|
#
|
@@ -44,7 +45,7 @@ module Ethon
|
|
44
45
|
# Sets socketdata option.
|
45
46
|
#
|
46
47
|
# @example Set socketdata option.
|
47
|
-
#
|
48
|
+
# multi.socketdata = $value
|
48
49
|
#
|
49
50
|
# @param [ String ] value The value to set.
|
50
51
|
#
|
@@ -56,7 +57,7 @@ module Ethon
|
|
56
57
|
# Sets socketfunction option.
|
57
58
|
#
|
58
59
|
# @example Set socketfunction option.
|
59
|
-
#
|
60
|
+
# multi.socketfunction = $value
|
60
61
|
#
|
61
62
|
# @param [ String ] value The value to set.
|
62
63
|
#
|
@@ -68,7 +69,7 @@ module Ethon
|
|
68
69
|
# Sets timerdata option.
|
69
70
|
#
|
70
71
|
# @example Set timerdata option.
|
71
|
-
#
|
72
|
+
# multi.timerdata = $value
|
72
73
|
#
|
73
74
|
# @param [ String ] value The value to set.
|
74
75
|
#
|
@@ -80,7 +81,7 @@ module Ethon
|
|
80
81
|
# Sets timerfunction option.
|
81
82
|
#
|
82
83
|
# @example Set timerfunction option.
|
83
|
-
#
|
84
|
+
# multi.timerfunction = $value
|
84
85
|
#
|
85
86
|
# @param [ String ] value The value to set.
|
86
87
|
#
|
data/lib/ethon/multi/stack.rb
CHANGED
data/lib/ethon/version.rb
CHANGED
data/profile/benchmarks.rb
CHANGED
data/profile/memory_leaks.rb
CHANGED
data/profile/perf_spec_helper.rb
CHANGED
data/spec/ethon/curl_spec.rb
CHANGED