pike.git
/
src
/
modules
/
_Roxen
/
roxen.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/_Roxen/roxen.c:39:
*! Class for parsing HTTP-requests. */ #define FLAG_THROW_ERROR 1 #define FLAG_KEEP_CASE 2 #define FLAG_NO_FOLD 4 #define THP ((struct header_buf *)Pike_fp->current_storage) struct header_buf {
-
unsigned char *headers;
-
unsigned char *pnt;
-
ptrdiff_t hsize, left;
-
int slash_n, tslash_n, spc;
+
unsigned char *headers;
/* Buffer containing the data so far. */
+
unsigned char *pnt;
/* End of headers. */
+
ptrdiff_t hsize, left;
/* Size of buffer, amount remaining. */
+
int slash_n, tslash_n, spc;
/* Number of nl, consecutive nl, spaces. */
int mode; }; static void f_hp_init( struct object *UNUSED(o) ) { THP->headers = NULL; THP->pnt = NULL; THP->hsize = 0; THP->left = 0; THP->spc = THP->slash_n = THP->tslash_n = 0;
pike.git/src/modules/_Roxen/roxen.c:166:
hp->slash_n = slash_n; hp->spc = spc; hp->tslash_n = tot_slash_n; hp->left -= str_len; hp->pnt += str_len; hp->pnt[0] = 0; if( slash_n != 2 ) {
+
/* No header terminating double newline. */
+
if( (spc < 2) && tot_slash_n )
+
{
/* one newline, but less than 2 space, * --> HTTP/0.9 or broken request */
-
if( (spc < 2) && tot_slash_n )
-
{
+
push_empty_string(); /* This includes (all eventual) \r\n etc. */
-
push_
text
((char *)hp->headers);
+
push_
string
(
make_shared_binary_string
(
(
char *)hp->headers
,
+
hp->hsize - hp->left
)
)
;
f_aggregate_mapping( 0 ); f_aggregate( 3 ); return; } push_int( 0 ); return; } /*leftovers*/ push_string(make_shared_binary_string((char *)pp, hp->pnt - pp));