patron 0.4.8 → 0.4.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.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/ext/patron/session_ext.c +5 -5
  3. metadata +4 -4
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 4
4
- :patch: 8
4
+ :patch: 9
5
5
  :build:
@@ -144,19 +144,19 @@ VALUE session_unescape(VALUE self, VALUE value) {
144
144
  }
145
145
 
146
146
  // Callback used to iterate over the HTTP headers and store them in an slist.
147
- static VALUE each_http_header(VALUE header, VALUE self) {
147
+ static int each_http_header(VALUE header_key, VALUE header_value, VALUE self) {
148
148
  struct curl_state *state;
149
149
  Data_Get_Struct(self, struct curl_state, state);
150
150
 
151
- VALUE name = rb_obj_as_string(rb_ary_entry(header, 0));
152
- VALUE value = rb_obj_as_string(rb_ary_entry(header, 1));
151
+ VALUE name = rb_obj_as_string(header_key);
152
+ VALUE value = rb_obj_as_string(header_value);
153
153
 
154
154
  VALUE header_str = Qnil;
155
155
  header_str = rb_str_plus(name, rb_str_new2(": "));
156
156
  header_str = rb_str_plus(header_str, value);
157
157
 
158
158
  state->headers = curl_slist_append(state->headers, StringValuePtr(header_str));
159
- return Qnil;
159
+ return 0;
160
160
  }
161
161
 
162
162
  static void set_chunked_encoding(struct curl_state *state) {
@@ -187,7 +187,7 @@ static void set_options_from_request(VALUE self, VALUE request) {
187
187
  rb_raise(rb_eArgError, "Headers must be passed in a hash.");
188
188
  }
189
189
 
190
- rb_iterate(rb_each, headers, each_http_header, self);
190
+ rb_hash_foreach(headers, each_http_header, self);
191
191
  }
192
192
 
193
193
  ID action = SYM2ID(rb_iv_get(request, "@action"));
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patron
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 8
10
- version: 0.4.8
9
+ - 9
10
+ version: 0.4.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Phillip Toland
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-02 00:00:00 -05:00
18
+ date: 2010-09-14 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies: []
21
21