Changeset 895
- Timestamp:
- 12/11/07 18:14:17 (9 months ago)
- Files:
-
- trunk/ext/http11/http11.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ext/http11/http11.c
r878 r895 9 9 #include "http11_parser.h" 10 10 #include <ctype.h> 11 12 #ifndef RSTRING_PTR 13 #define RSTRING_PTR(s) (RSTRING(s)->ptr) 14 #endif 15 #ifndef RSTRING_LEN 16 #define RSTRING_LEN(s) (RSTRING(s)->len) 17 #endif 11 18 12 19 static VALUE mMongrel; … … 75 82 f = rb_str_buf_cat(f, field, flen); 76 83 77 for(ch = RSTRING (f)->ptr, end = ch + RSTRING(f)->len; ch < end; ch++) {84 for(ch = RSTRING_PTR(f), end = ch + RSTRING_LEN(f); ch < end; ch++) { 78 85 if(*ch == '-') { 79 86 *ch = '_'; … … 170 177 if((temp = rb_hash_aref(req, global_http_host)) != Qnil) { 171 178 /* ruby better close strings off with a '\0' dammit */ 172 colon = strchr(RSTRING (temp)->ptr, ':');179 colon = strchr(RSTRING_PTR(temp), ':'); 173 180 if(colon != NULL) { 174 rb_hash_aset(req, global_server_name, rb_str_substr(temp, 0, colon - RSTRING (temp)->ptr));181 rb_hash_aset(req, global_server_name, rb_str_substr(temp, 0, colon - RSTRING_PTR(temp))); 175 182 rb_hash_aset(req, global_server_port, 176 rb_str_substr(temp, colon - RSTRING (temp)->ptr+1,177 RSTRING (temp)->len));183 rb_str_substr(temp, colon - RSTRING_PTR(temp)+1, 184 RSTRING_LEN(temp))); 178 185 } else { 179 186 rb_hash_aset(req, global_server_name, temp); … … 296 303 297 304 from = FIX2INT(start); 298 dptr = RSTRING (data)->ptr;299 dlen = RSTRING (data)->len;305 dptr = RSTRING_PTR(data); 306 dlen = RSTRING_LEN(data); 300 307 301 308 if(from >= dlen) {
