FreeBSD Bugzilla – Attachment 59330 Details for
Bug 89308
[patch] www/mod_accounting crash on request_timeout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
mod_accounting.patch
mod_accounting.patch (text/plain), 2.06 KB, created by
Andrey Yakovlev
on 2005-11-20 11:50:17 UTC
(
hide
)
Description:
mod_accounting.patch
Filename:
MIME Type:
Creator:
Andrey Yakovlev
Created:
2005-11-20 11:50:17 UTC
Size:
2.06 KB
patch
obsolete
>*** mod_accounting.c.orig Sun Sep 8 18:17:22 2002 >--- mod_accounting.c Fri Nov 11 11:26:43 2005 >*************** >*** 140,146 **** > // computes the number of bytes received > static long BytesRecvd( request_rec *r ) > { >! long recvd; > const char *len; > > #ifdef DEBUG >--- 140,146 ---- > // computes the number of bytes received > static long BytesRecvd( request_rec *r ) > { >! long recvd=0; > const char *len; > > #ifdef DEBUG >*************** >*** 148,153 **** >--- 148,155 ---- > "BytesRecvd" ); > #endif > >+ if( ! r ) return( 0 ); // empty request >+ if( ! r->the_request ) return( 0 ); // empty request > recvd = strlen( r->the_request ) + TableLen( r, r->headers_in ) + 4; // 2 for CRLF after the request, 2 for CRLF after all headers > > len = ap_table_get( r->headers_in, "Content-Length" ); >--- mysql.c.orig Sat Jan 5 13:50:50 2002 >+++ mysql.c Tue Apr 19 23:32:07 2005 >@@ -76,16 +76,39 @@ > > if( cfg->DBHandle ) { > >- retval = mysql_query(( MYSQL * )cfg->DBHandle, query ); >+ // >+ // loop for handling multiple SQL >+ char* new_query; >+ char* end_; >+ char* copy_query = malloc(strlen(query)+1); >+ >+ (void) strcpy (copy_query, query); >+ >+ end_ = copy_query - 1; >+ >+ do { >+ >+ new_query = end_ + 1; >+ >+ // locate occurance of ';' >+ end_ = strchr( new_query, ';' ); >+ >+ if (end_) *end_ = 0; >+ >+ retval = mysql_query(( MYSQL * )cfg->DBHandle, new_query ); > >- if( retval ) { >+ if( retval ) { > >- ap_log_error( APLOG_MARK,ERRLEVEL, server, >- ap_pstrcat( p, "MySQL insert failed: ", query, NULL )); >+ ap_log_error( APLOG_MARK,ERRLEVEL, server, >+ ap_pstrcat( p, "MySQL insert failed: ", query, NULL )); > >- ap_log_error( APLOG_MARK, ERRLEVEL, server, >- ap_pstrcat( p, "MySQL failure reason: ", MYSQL_ERROR( cfg->DBHandle ), NULL )); >- } >+ ap_log_error( APLOG_MARK, ERRLEVEL, server, >+ ap_pstrcat( p, "MySQL failure reason: ", MYSQL_ERROR( cfg->DBHandle ), NULL )); >+ } >+ >+ } while ( end_ ); >+ >+ free( copy_query ); > } > > signal( SIGPIPE, handler );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 89308
: 59330