|
Lines 74-80
Link Here
|
| 74 |
f = rb_str_dup(global_http_prefix); |
74 |
f = rb_str_dup(global_http_prefix); |
| 75 |
f = rb_str_buf_cat(f, field, flen); |
75 |
f = rb_str_buf_cat(f, field, flen); |
| 76 |
|
76 |
|
| 77 |
for(ch = RSTRING(f)->ptr, end = ch + RSTRING(f)->len; ch < end; ch++) { |
77 |
for(ch = RSTRING_PTR(f), end = ch + RSTRING_LEN(f); ch < end; ch++) { |
| 78 |
if(*ch == '-') { |
78 |
if(*ch == '-') { |
| 79 |
*ch = '_'; |
79 |
*ch = '_'; |
| 80 |
} else { |
80 |
} else { |
|
Lines 157-168
Link Here
|
| 157 |
|
157 |
|
| 158 |
rb_hash_aset(req, global_gateway_interface, global_gateway_interface_value); |
158 |
rb_hash_aset(req, global_gateway_interface, global_gateway_interface_value); |
| 159 |
if((temp = rb_hash_aref(req, global_http_host)) != Qnil) { |
159 |
if((temp = rb_hash_aref(req, global_http_host)) != Qnil) { |
| 160 |
colon = strchr(RSTRING(temp)->ptr, ':'); |
160 |
colon = strchr(RSTRING_PTR(temp), ':'); |
| 161 |
if(colon != NULL) { |
161 |
if(colon != NULL) { |
| 162 |
rb_hash_aset(req, global_server_name, rb_str_substr(temp, 0, colon - RSTRING(temp)->ptr)); |
162 |
rb_hash_aset(req, global_server_name, rb_str_substr(temp, 0, colon - RSTRING_PTR(temp))); |
| 163 |
rb_hash_aset(req, global_server_port, |
163 |
rb_hash_aset(req, global_server_port, |
| 164 |
rb_str_substr(temp, colon - RSTRING(temp)->ptr+1, |
164 |
rb_str_substr(temp, colon - RSTRING_PTR(temp)+1, |
| 165 |
RSTRING(temp)->len)); |
165 |
RSTRING_LEN(temp))); |
| 166 |
} else { |
166 |
} else { |
| 167 |
rb_hash_aset(req, global_server_name, temp); |
167 |
rb_hash_aset(req, global_server_name, temp); |
| 168 |
rb_hash_aset(req, global_server_port, global_port_80); |
168 |
rb_hash_aset(req, global_server_port, global_port_80); |
|
Lines 281-288
Link Here
|
| 281 |
DATA_GET(self, http_parser, http); |
281 |
DATA_GET(self, http_parser, http); |
| 282 |
|
282 |
|
| 283 |
from = FIX2INT(start); |
283 |
from = FIX2INT(start); |
| 284 |
dptr = RSTRING(data)->ptr; |
284 |
dptr = RSTRING_PTR(data); |
| 285 |
dlen = RSTRING(data)->len; |
285 |
dlen = RSTRING_LEN(data); |
| 286 |
|
286 |
|
| 287 |
if(from >= dlen) { |
287 |
if(from >= dlen) { |
| 288 |
rb_raise(eHttpParserError, "Requested start is after data buffer end."); |
288 |
rb_raise(eHttpParserError, "Requested start is after data buffer end."); |
|
Lines 512-518
Link Here
|
| 512 |
if(pref_len == 1 && uri_str[0] == '/') { |
512 |
if(pref_len == 1 && uri_str[0] == '/') { |
| 513 |
rb_ary_push(result, uri); |
513 |
rb_ary_push(result, uri); |
| 514 |
} else { |
514 |
} else { |
| 515 |
rb_ary_push(result, rb_str_substr(uri, pref_len, RSTRING(uri)->len)); |
515 |
rb_ary_push(result, rb_str_substr(uri, pref_len, RSTRING_LEN(uri))); |
| 516 |
} |
516 |
} |
| 517 |
|
517 |
|
| 518 |
rb_ary_push(result, (VALUE)handler); |
518 |
rb_ary_push(result, (VALUE)handler); |