pike.git
/
src
/
modules
/
_Roxen
/
roxen.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/_Roxen/roxen.c:72:
THP->pnt += str->len; THP->pnt[0] = 0; pop_n_elems( args ); if( slash_n != 2 ) { /* check for HTTP/0.9? */ push_int( 0 ); return; }
-
push_
text
( pp ); // leftovers
+
push_
string
(
make_shared_binary_string(
pp
,
TPH->pnt - pp
)
)
; // leftovers
headers = allocate_mapping( 5 ); in = THP->headers; l = pp - THP->headers;
-
+
/* find first line here */ for( i = 0; i < l; i++ ) if( in[i] == '\n' ) break; if( in[i-1] != '\r' ) i++; push_string( make_shared_binary_string( in, i-1 ) ); in += i; l -= i; if( *in == '\n' ) (in++),(l--); for(i = 0; i < l; i++) {
-
if( in[i] == ':' )
+
if(
in[j]
> 64 &&
in[
j] < 91) in[j]+=32;
+
else if( in[
i] == ':' )
{ /* in[os..i-1] == the header */
-
for(j=os;j<i;j++) if(in[j] > 63 && in[j] < 91) in[j]+=32;
+
push_string(make_shared_binary_string((char*)in+os,i-os)); os = i+1; while(in[os]==' ') os++; for(j=os;j<l;j++) if( in[j] == '\n' || in[j]=='\r') { break; } push_string(make_shared_binary_string((char*)in+os,j-os));
pike.git/src/modules/_Roxen/roxen.c:124:
tmp->u.string->refs++; push_string(tmp->u.string); f_aggregate(1); map_delete(headers, Pike_sp-3); f_add(2); } } mapping_insert(headers, Pike_sp-2, Pike_sp-1); pop_n_elems(2); if( in[j+1] == '\n' ) j++;
-
os = i =
j+1
;
+
os =
j+1;
+
i =
j
;
} } push_mapping( headers ); f_aggregate( 3 ); /* data, headers */ } static void f_hp_create( INT32 args ) { THP->pnt = THP->headers; THP->left = 8192;