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

version» Context lines:

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.43 2005/04/08 17:24:39 grubba Exp $ + || $Id: roxen.c,v 1.44 2005/04/09 10:35:53 grubba Exp $   */      #define NO_PIKE_SHORTHAND      #include "global.h"   #include "config.h"         #include "machine.h"   
pike.git/src/modules/_Roxen/roxen.c:130:       if( slash_n != 2 )    {    /* one newline, but less than 2 space,    * --> HTTP/0.9 or broken request    */    if( (spc < 2) && tot_slash_n )    {    push_constant_text( "" );    /* This includes (all eventual) \r\n etc. */ -  push_text( hp->headers ); +  push_text((char *)hp->headers);    f_aggregate_mapping( 0 );    f_aggregate( 3 );    return;    }    push_int( 0 );    return;    }    -  push_string( make_shared_binary_string( pp, hp->pnt - pp ) ); /*leftovers*/ +  /*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( in, i ) ); +  push_string(make_shared_binary_string((char *)in, i));       if((in[i] == '\r') && (in[i+1] == '\n'))    i++;    i++;       in += i; l -= i;       /* Parse headers. */    for(i = 0; i < l; i++)    {
pike.git/src/modules/_Roxen/roxen.c:280:    total_len += kl + a->item[i].u.string->len + 2;    } else    Pike_error("Wrong argument type to make_http_headers("    "mapping(string(8bit):string(8bit)|"    "array(string(8bit))) heads)\n");    }    total_len += 2;       res = begin_shared_string( total_len );    pnt = STR0(res); - #define STRADD(X)\ -  for( l=X.u.string->len,s=X.u.string->str,c=0; c<l; c++ )\ -  *(pnt++)=*(s++); + #define STRADD(X) \ +  for( l=(X).u.string->len, s=STR0((X).u.string), c=0; c<l; c++ ) \ +  *(pnt++)=*(s++)       NEW_MAPPING_LOOP( m->data )    {    unsigned char *s;    ptrdiff_t l, c;    if( k->val.type == PIKE_T_STRING )    {    STRADD( k->ind ); *(pnt++) = ':'; *(pnt++) = ' ';    STRADD( k->val ); *(pnt++) = '\r'; *(pnt++) = '\n';    }