From: Gonzalo A. <ga...@us...> - 2008-11-05 15:03:57
|
Update of /cvsroot/mod-c/ehtml/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27950/src Modified Files: Request.cpp Log Message: * Added a comment on the Cookie argument format. * Fixed support for variables spanning more than one buffer ending. Index: Request.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Request.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Request.cpp 12 Mar 2007 23:14:43 -0000 1.29 --- Request.cpp 5 Nov 2008 15:03:48 -0000 1.30 *************** *** 222,225 **** --- 222,226 ---- s = skip_ws(s); } + // Name=Value (; (Comment|Domain|Max-Age|Path|Version|Expires)=value|Secure)* } *************** *** 272,275 **** --- 273,277 ---- char *aux = buf, *eol, *eop, *eo_name; bool is_file, again; + bool new_var = false; DEBUG_UPLOAD("ProcessUploadChunk: nbytes=%u boundary_length=%u", nbytes, boundary_length); if (nbytes < boundary_length) *************** *** 334,337 **** --- 336,340 ---- state = 'F'; } + new_var = true; case 'v': case 'F': *************** *** 351,357 **** DEBUG_UPLOAD("ProcessUploadChunk: state = %c: eop=\"%s\"", state, eop); if (state == 'v') { // variable ! DEBUG_UPLOAD("ProcessUploadChunk: \"%s\" += string(\"%s\",%d)", varname, aux, eop-aux); ! Arguments[varname] += string(aux,eop-aux); ! DEBUG_UPLOAD("ProcessUploadChunk: state = v: got variable \"%s\" => \"%s\"", varname, Arguments[varname].c_str()); } else { // file int fd = GetFile(varname); --- 354,364 ---- DEBUG_UPLOAD("ProcessUploadChunk: state = %c: eop=\"%s\"", state, eop); if (state == 'v') { // variable ! string val(aux,eop-aux); ! DEBUG_UPLOAD("ProcessUploadChunk: \"%s\" += \"%s\"", varname, val.c_str()); ! if (!new_var) ! Arguments[varname] += val; ! else ! Arguments.insert(pair<string,string>(varname, val)); ! DEBUG_UPLOAD("ProcessUploadChunk: state = v: got variable \"%s\" => \"%s\"", varname, val.c_str()); } else { // file int fd = GetFile(varname); |