pike.git / src / modules / _Roxen / roxen.c

version» Context lines:

pike.git/src/modules/_Roxen/roxen.c:89:    *! First line of request.    *! @elem mapping(string:string|array(string)) 2    *! Headers.    *! @endarray    */   {    struct pike_string *str = Pike_sp[-args].u.string;    struct header_buf *hp = THP;    int keep_case = hp->mode & FLAG_KEEP_CASE;    int str_len; -  int tot_slash_n=hp->slash_n, slash_n = hp->tslash_n, spc = hp->spc; +  int tot_slash_n=hp->tslash_n, slash_n = hp->slash_n, spc = hp->spc;    unsigned char *pp,*ep;    struct svalue *tmp;    struct mapping *headers;    ptrdiff_t os=0, i, j, l;    unsigned char *in;       if( !( args == 1 || args == 2 ) )    Pike_error("Bad number of arguments to feed().\n");    if( TYPEOF(Pike_sp[-args]) != PIKE_T_STRING )    Pike_error("Wrong type of argument to feed()\n");
pike.git/src/modules/_Roxen/roxen.c:138:    Pike_error("Running out of memory in header parser\n");    }    hp->left += 8192;    hp->pnt = (hp->headers + hp->hsize - hp->left);    }       memcpy( hp->pnt, str->str, str_len );    pop_n_elems( args );       /* FIXME: The below does not support lines terminated with just \r. */ -  for( ep=(hp->pnt+str_len),pp=MAXIMUM(hp->headers,hp->pnt-3); +  for( ep=(hp->pnt+str_len),pp=MAXIMUM(hp->headers,hp->pnt);    pp<ep && slash_n<2; pp++ )    if( *pp == ' ' )    {    spc++;    slash_n = 0;    }    else if( *pp == '\n' )    {    slash_n++;    tot_slash_n++;    }    else if( *pp != '\r' )    {    slash_n=0;    }    -  hp->slash_n = tot_slash_n; +  hp->slash_n = slash_n;    hp->spc = spc; -  hp->tslash_n = slash_n; +  hp->tslash_n = tot_slash_n;    hp->left -= str_len;    hp->pnt += str_len;    hp->pnt[0] = 0;       if( slash_n != 2 )    {    /* one newline, but less than 2 space,    * --> HTTP/0.9 or broken request    */    if( (spc < 2) && tot_slash_n )