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

version» Context lines:

pike.git/src/modules/_Roxen/roxen.c:187:    f_aggregate_mapping( 0 );    f_aggregate( 3 );    return;    }    push_int( 0 );    return;    }       /*leftovers*/    push_string(make_shared_binary_string((char *)pp, hp->pnt - pp)); -  headers = allocate_mapping( 5 ); +     in = hp->headers;    l = pp - hp->headers;       /* find first line here */    for( i = 0; i < l; i++ )    if( (in[i] == '\n') || (in[i] == '\r') )    break;       push_string(make_shared_binary_string((char *)in, i));       if((in[i] == '\r') && (in[i+1] == '\n'))    i++;    i++;       in += i; l -= i;    -  +  headers = allocate_mapping( 5 ); +  push_mapping(headers); +     /* Parse headers. */    for(i = 0; i < l; i++)    {    if(!keep_case && (in[i] > 64 && in[i] < 91))    {    in[i]+=32; /* lower_case */    }    else if( in[i] == ':' )    {    /* Does not support white space before the colon. This is in
pike.git/src/modules/_Roxen/roxen.c:278:    {    if( THP->mode & FLAG_THROW_ERROR )    {    /* FIXME: Reset stack so that backtrace shows faulty header. */    Pike_error("Malformed HTTP header.\n");    }    else    os = i+1;    }    } -  push_mapping( headers ); +     f_aggregate( 3 ); /* data, firstline, headers */   }      static void f_hp_create( INT32 args )   /*! @decl void create(void|int throw_errors, void|int keep_case, @    *! void|int no_fold)    *!    *! @param throw_errors    *! If true the parser will throw an error instead of silently    *! trying to recover from broken HTTP headers.