pike.git
/
src
/
modules
/
_Roxen
/
roxen.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/_Roxen/roxen.c:1:
/* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: roxen.c,v 1.
53
2008
/
08
/
24
21
:
32
:
00
srb
Exp $
+
|| $Id: roxen.c,v 1.
54
2009
/
07
/
17
14
:
33
:
51
grubba
Exp $
*/ #define NO_PIKE_SHORTHAND #include "global.h" #include "config.h" #include "machine.h"
pike.git/src/modules/_Roxen/roxen.c:35:
#include "module_support.h" #include "backend.h" #include "threads.h" #include "operators.h" /*! @module _Roxen */ /*! @class HeaderParser
+
*!
+
*! Class for parsing HTTP-requests.
*/ #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; };
pike.git/src/modules/_Roxen/roxen.c:66:
{ if( THP->headers ) free( THP->headers ); THP->headers = NULL; THP->pnt = NULL; THP->hsize = 0; } static void f_hp_feed( INT32 args ) /*! @decl array(string|mapping) feed(string data)
+
*!
+
*! @returns
+
*! @array
+
*! @elem string 0
+
*! Trailing data.
+
*! @elem string 1
+
*! First line of request.
+
*! @elem mapping(string:string|array(string)) 2
+
*! Headers.
+
*! @endarray
*/ { struct pike_string *str = Pike_sp[-1].u.string; struct header_buf *hp = THP; int str_len; int tot_slash_n=hp->slash_n, slash_n = hp->tslash_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)
+
Pike_error("Bad number of arguments to feed().\n");
if( Pike_sp[-1].type != PIKE_T_STRING ) Pike_error("Wrong type of argument to feed()\n"); if( str->size_shift ) Pike_error("Wide string headers not supported\n"); str_len = str->len; while( str_len >= hp->left ) { unsigned char *buf; if( hp->hsize > 512 * 1024 ) Pike_error("Too many headers\n");