curb 0.7.0 → 0.7.1

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 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.7.0"
24
- #define CURB_VER_NUM 700
23
+ #define CURB_VERSION "0.7.1"
24
+ #define CURB_VER_NUM 701
25
25
  #define CURB_VER_MAJ 0
26
26
  #define CURB_VER_MIN 7
27
- #define CURB_VER_MIC 0
27
+ #define CURB_VER_MIC 1
28
28
  #define CURB_VER_PATCH 0
29
29
 
30
30
 
@@ -2330,13 +2330,14 @@ static VALUE ruby_curl_easy_response_code_get(VALUE self) {
2330
2330
  return LONG2NUM(code);
2331
2331
  }
2332
2332
 
2333
+ #if defined(HAVE_CURLINFO_PRIMARY_IP)
2333
2334
  /*
2334
2335
  * call-seq:
2335
2336
  * easy.primary_ip => "xx.xx.xx.xx" or nil
2336
2337
  *
2337
2338
  * Retrieve the resolved IP of the most recent connection
2338
2339
  * done with this curl handle. This string may be IPv6 if
2339
- * that's enabled.
2340
+ * that's enabled. This feature requires curl 7.19.x and above
2340
2341
  */
2341
2342
  static VALUE ruby_curl_easy_primary_ip_get(VALUE self) {
2342
2343
  ruby_curl_easy *rbce;
@@ -2351,6 +2352,7 @@ static VALUE ruby_curl_easy_primary_ip_get(VALUE self) {
2351
2352
  return Qnil;
2352
2353
  }
2353
2354
  }
2355
+ #endif
2354
2356
 
2355
2357
  /*
2356
2358
  * call-seq:
@@ -3172,7 +3174,9 @@ void init_curb_easy() {
3172
3174
 
3173
3175
  rb_define_method(cCurlEasy, "last_effective_url", ruby_curl_easy_last_effective_url_get, 0);
3174
3176
  rb_define_method(cCurlEasy, "response_code", ruby_curl_easy_response_code_get, 0);
3177
+ #if defined(HAVE_CURLINFO_PRIMARY_IP)
3175
3178
  rb_define_method(cCurlEasy, "primary_ip", ruby_curl_easy_primary_ip_get, 0);
3179
+ #endif
3176
3180
  rb_define_method(cCurlEasy, "http_connect_code", ruby_curl_easy_http_connect_code_get, 0);
3177
3181
  rb_define_method(cCurlEasy, "file_time", ruby_curl_easy_file_time_get, 0);
3178
3182
  rb_define_method(cCurlEasy, "total_time", ruby_curl_easy_total_time_get, 0);
@@ -114,6 +114,7 @@ have_constant "curle_ssl_issuer_error"
114
114
  # username/password added in 7.19.1
115
115
  have_constant "curlopt_username"
116
116
  have_constant "curlopt_password"
117
+ have_constant "curlinfo_primary_ip"
117
118
 
118
119
  # ie quirk added in 7.19.3
119
120
  have_constant "curlauth_digest_ie"
@@ -690,6 +690,14 @@ class TestCurbCurlEasy < Test::Unit::TestCase
690
690
  assert_equal 'NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=', $auth_header
691
691
  end
692
692
 
693
+ def test_primary_ip
694
+ curl = Curl::Easy.new(TestServlet.url)
695
+ if curl.respond_to?(:primary_ip)
696
+ curl.perform
697
+ assert_equal '127.0.0.1', curl.primary_ip
698
+ end
699
+ end
700
+
693
701
  include TestServerMethods
694
702
 
695
703
  def setup
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 0
9
- version: 0.7.0
8
+ - 1
9
+ version: 0.7.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ross Bamford
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-18 00:00:00 -04:00
18
+ date: 2010-04-20 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21