Update of /cvsroot/mod-c/ehtml/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4952/src
Modified Files:
Request.cpp
Log Message:
* ContentLength is now a long value, rather than a pair of C strings.
Index: Request.cpp
===================================================================
RCS file: /cvsroot/mod-c/ehtml/src/Request.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** Request.cpp 1 Dec 2006 14:43:34 -0000 1.21
--- Request.cpp 1 Dec 2006 14:45:47 -0000 1.22
***************
*** 33,36 ****
--- 33,38 ----
#include "Profiling.h"
+ #include <http_log.h>
+
using namespace std;
***************
*** 41,45 ****
Request::Request( EHTMLApplication * App )
! : RequestContext( App->GetRequestContext() ), Application( App ), HeaderParsed( false ), ContentLength( 0 )
{
}
--- 43,47 ----
Request::Request( EHTMLApplication * App )
! : RequestContext( App->GetRequestContext() ), Application( App ), HeaderParsed( false ), ContentLength( -1 )
{
}
***************
*** 82,97 ****
// Do we have the content length
! if ( ContentLength )
{
ap_setup_client_block( r, REQUEST_CHUNKED_ERROR );
if ( ap_should_client_block( r ) )
{
! int len = atoi( ContentLength->Value );
! if ( len > 0 )
! {
! content = new char[len + 1];
! error = ap_get_client_block( r, content, len ) == 0;
! content[len] = 0;
! }
}
}
--- 84,95 ----
// Do we have the content length
! if ( ContentLength > 0 )
{
ap_setup_client_block( r, REQUEST_CHUNKED_ERROR );
if ( ap_should_client_block( r ) )
{
! content = new char[ContentLength + 1];
! error = ap_get_client_block( r, content, ContentLength) == 0;
! content[ContentLength] = 0;
}
}
***************
*** 241,247 ****
// Content length?
! if ( !ContentLength && strncasecmp( "tent-Length", _tmp + 1, 11 ) == 0 )
// We have the content length
! ContentLength = ( HeaderEntry* ) tmp;
}
}
--- 239,256 ----
// Content length?
! if ( ContentLength == - 1 && strncasecmp( "tent-Length", _tmp + 1, 11 ) == 0 ) {
// We have the content length
! char* end;
! unsigned long clen = strtoul(tmp->value, &end, 10);
! if (*end != '\0') {
! ap_log_error(APLOG_MARK, APLOG_ERR, 0, RequestContext->r->server,
! "Invalid content length header value \"%s\"", tmp->value);
! } else if (clen > LONG_MAX) {
! ap_log_error(APLOG_MARK, APLOG_ERR, 0, RequestContext->r->server,
! "Content length header value \"%s\" too long", tmp->value);
! } else {
! ContentLength = clen;
! }
! }
}
}
|