code review

Robert Schulze <[email protected]> Mon, 18 Feb 2008 10:15:50 +0100
Newsgroups gmane.comp.apache.mod-log-sql
Message-ID <[email protected]>
Hi

last weekend I spent a lot of time with reviewing the code in 
mod_log_sql. What I often noticed, were wrong string-assignments.

Except in declaration, one can't assign a string with the help of '='.
The same problem is in some of the extraction-functions, which 'return 
"-"', without allocating space for the string.

I fixed all those non-allocated string occurances in mod_log_sql.c, 
functions*.h and mod_log_sql_mysql.c

I've also rewritten that big makro DO_MERGE_ARRAY in mod_log_sql.c to a 
function and cleaned up the code a little bit, especially in 
mod_log_sql_transaction.

The patch against 1.101 is available here (which also includes the 
one-liner to set the apr_pool_cleanup_null):

http://www.rob-schulze.de/publikationen/frickelworx/mod_log_sql-patch/diff


Don't be afraid, most of it is 'deleting a tab', due to removing 
else-statements, in case of a return() in the previous if-statement ;-)


with kind regards,

Robert Schulze

-- 
/7\ bytecamp GmbH
Geschwister-Scholl-Str. 10, 14776 Brandenburg a.d. Havel
HRB15752, Amtsgericht Potsdam, Geschaeftsfuehrer:
Bjoern Barnekow, Frank Rosenbaum, Sirko Zidlewitz
tel +49 3381 79637-0 werktags 10-12,13-17 Uhr, fax +49 3381 79637-20
mail [email protected], web http://bytecamp.net/
_______________________________________________
Download the latest version at http://www.outoforder.cc/projects/apache/mod_log_sql/

To unsubscribe send an e-mail to 
mod_log_sql-unsubscribe-7qY7E20V6GW73k+5HYS8LQqVMODqnSLI@public.gmane.org