curb 0.5.8.0 → 0.5.9.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of curb might be problematic. Click here for more details.
- data/ext/curb.h +3 -3
- data/ext/curb_multi.c +1 -9
- data/tests/tc_curl_multi.rb +4 -3
- metadata +15 -15
data/ext/curb.h
CHANGED
@@ -20,11 +20,11 @@
|
|
20
20
|
#include "curb_macros.h"
|
21
21
|
|
22
22
|
// These should be managed from the Rake 'release' task.
|
23
|
-
#define CURB_VERSION "0.5.
|
24
|
-
#define CURB_VER_NUM
|
23
|
+
#define CURB_VERSION "0.5.9.0"
|
24
|
+
#define CURB_VER_NUM 590
|
25
25
|
#define CURB_VER_MAJ 0
|
26
26
|
#define CURB_VER_MIN 5
|
27
|
-
#define CURB_VER_MIC
|
27
|
+
#define CURB_VER_MIC 9
|
28
28
|
#define CURB_VER_PATCH 0
|
29
29
|
|
30
30
|
|
data/ext/curb_multi.c
CHANGED
@@ -32,7 +32,6 @@ static void rb_curl_multi_remove(ruby_curl_multi *rbcm, VALUE easy);
|
|
32
32
|
static void rb_curl_multi_read_info(VALUE self, CURLM *mptr);
|
33
33
|
|
34
34
|
static void rb_curl_multi_mark_all_easy(VALUE key, VALUE rbeasy, ruby_curl_multi *rbcm) {
|
35
|
-
//printf( "mark easy: 0x%X\n", (long)rbeasy );
|
36
35
|
rb_gc_mark(rbeasy);
|
37
36
|
}
|
38
37
|
|
@@ -42,20 +41,14 @@ static void curl_multi_mark(ruby_curl_multi *rbcm) {
|
|
42
41
|
}
|
43
42
|
|
44
43
|
static void curl_multi_flush_easy(VALUE key, VALUE easy, ruby_curl_multi *rbcm) {
|
45
|
-
//rb_curl_multi_remove(rbcm, easy);
|
46
44
|
CURLMcode result;
|
47
45
|
ruby_curl_easy *rbce;
|
48
|
-
|
46
|
+
|
49
47
|
Data_Get_Struct(easy, ruby_curl_easy, rbce);
|
50
48
|
result = curl_multi_remove_handle(rbcm->handle, rbce->curl);
|
51
49
|
if (result != 0) {
|
52
50
|
raise_curl_multi_error_exception(result);
|
53
51
|
}
|
54
|
-
// XXX: easy handle may not be finished yet... so don't clean it GC pass will get it next time
|
55
|
-
r = rb_hash_delete( rbcm->requests, easy );
|
56
|
-
if( r != easy || r == Qnil ) {
|
57
|
-
rb_raise(rb_eRuntimeError, "Critical:: Unable to remove easy from requests");
|
58
|
-
}
|
59
52
|
}
|
60
53
|
|
61
54
|
static int
|
@@ -65,7 +58,6 @@ rb_hash_clear_i(VALUE key, VALUE value, VALUE dummy) {
|
|
65
58
|
|
66
59
|
static void curl_multi_free(ruby_curl_multi *rbcm) {
|
67
60
|
|
68
|
-
//printf("hash entries: %d\n", RHASH(rbcm->requests)->tbl->num_entries );
|
69
61
|
if (rbcm && !rbcm->requests == Qnil && rb_type(rbcm->requests) == T_HASH && RHASH_LEN(rbcm->requests) > 0) {
|
70
62
|
|
71
63
|
rb_hash_foreach( rbcm->requests, (int (*)())curl_multi_flush_easy, (VALUE)rbcm );
|
data/tests/tc_curl_multi.rb
CHANGED
@@ -381,7 +381,7 @@ class TestCurbCurlMulti < Test::Unit::TestCase
|
|
381
381
|
|
382
382
|
def test_remove_exception_is_descriptive
|
383
383
|
m = Curl::Multi.new
|
384
|
-
c = Curl::Easy.new("http://
|
384
|
+
c = Curl::Easy.new("http://127.9.9.9:999110")
|
385
385
|
m.remove(c)
|
386
386
|
rescue => e
|
387
387
|
assert_equal 'Invalid easy handle', e.message
|
@@ -393,9 +393,9 @@ class TestCurbCurlMulti < Test::Unit::TestCase
|
|
393
393
|
|
394
394
|
tries = 2
|
395
395
|
|
396
|
-
c1 = Curl::Easy.new('http://127.
|
396
|
+
c1 = Curl::Easy.new('http://127.1.1.1:99911') do |curl|
|
397
397
|
curl.on_failure {|c,e|
|
398
|
-
assert_equal [Curl::Err::
|
398
|
+
assert_equal [Curl::Err::MalformedURLError, "URL using bad/illegal format or missing URL"], e
|
399
399
|
if tries > 0
|
400
400
|
tries -= 1
|
401
401
|
m.add(c)
|
@@ -410,6 +410,7 @@ class TestCurbCurlMulti < Test::Unit::TestCase
|
|
410
410
|
m.perform
|
411
411
|
end
|
412
412
|
assert_equal 0, tries
|
413
|
+
assert_equal 0, m.requests.size
|
413
414
|
end
|
414
415
|
|
415
416
|
include TestServerMethods
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ross Bamford
|
@@ -29,21 +29,21 @@ files:
|
|
29
29
|
- Rakefile
|
30
30
|
- doc.rb
|
31
31
|
- ext/extconf.rb
|
32
|
-
- lib/curl.rb
|
33
32
|
- lib/curb.rb
|
33
|
+
- lib/curl.rb
|
34
34
|
- ext/curb.c
|
35
|
-
- ext/curb_upload.c
|
36
|
-
- ext/curb_postfield.c
|
37
35
|
- ext/curb_easy.c
|
38
|
-
- ext/curb_multi.c
|
39
36
|
- ext/curb_errors.c
|
40
|
-
- ext/
|
41
|
-
- ext/
|
37
|
+
- ext/curb_multi.c
|
38
|
+
- ext/curb_postfield.c
|
39
|
+
- ext/curb_upload.c
|
42
40
|
- ext/curb.h
|
43
41
|
- ext/curb_easy.h
|
42
|
+
- ext/curb_errors.h
|
43
|
+
- ext/curb_macros.h
|
44
|
+
- ext/curb_multi.h
|
44
45
|
- ext/curb_postfield.h
|
45
46
|
- ext/curb_upload.h
|
46
|
-
- ext/curb_macros.h
|
47
47
|
has_rdoc: true
|
48
48
|
homepage: http://curb.rubyforge.org/
|
49
49
|
licenses: []
|
@@ -75,15 +75,15 @@ signing_key:
|
|
75
75
|
specification_version: 3
|
76
76
|
summary: Ruby libcurl bindings
|
77
77
|
test_files:
|
78
|
-
- tests/
|
79
|
-
- tests/
|
80
|
-
- tests/tc_curl_postfield.rb
|
78
|
+
- tests/alltests.rb
|
79
|
+
- tests/bug_curb_easy_blocks_ruby_threads.rb
|
81
80
|
- tests/bug_instance_post_differs_from_class_post.rb
|
82
81
|
- tests/bug_multi_segfault.rb
|
83
|
-
- tests/
|
82
|
+
- tests/bug_require_last_or_segfault.rb
|
83
|
+
- tests/helper.rb
|
84
84
|
- tests/require_last_or_segfault_script.rb
|
85
|
-
- tests/unittests.rb
|
86
|
-
- tests/tc_curl_multi.rb
|
87
85
|
- tests/tc_curl_download.rb
|
88
86
|
- tests/tc_curl_easy.rb
|
89
|
-
- tests/
|
87
|
+
- tests/tc_curl_multi.rb
|
88
|
+
- tests/tc_curl_postfield.rb
|
89
|
+
- tests/unittests.rb
|