Bug 42699

Summary: share mod_logio data with other modules
Product: Apache httpd-2 Reporter: Matthew Kent <mkent>
Component: mod_logioAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: enhancement CC: urkle
Priority: P2 Keywords: PatchAvailable
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: adds notes with byte counts
Add in an optional hook along side optional function.
Updated patch

Description Matthew Kent 2007-06-20 00:07:34 UTC
Small patch to add the byte counts from mod_logio to r->notes for pickup in
other modules. It adds a hook to do this at the start of the order and moves the
logio_transaction, which clears the data, to the end.

For myself this data is extremely useful with mod_ruby and I expect would be for
others in mod_perl, mod_python etc. This would also hopefully solve issues like
outoforder.cc mod_log_sql having to include their own replacement version of

Question though: should this be an option? Perhaps allowing users to chose the
name of the notes like mod_deflate?

Willing to revise based on feedback. Thanks.
Comment 1 Matthew Kent 2007-06-20 00:09:05 UTC
Created attachment 20373 [details]
adds notes with byte counts
Comment 2 Edward Rudd 2007-12-30 16:54:59 UTC
Another option would be to change the optional function into a hook so that 
multiple modules can hook into the data.  I am currently writing a quota module 
that needs to know how much was ACTUALLY sent out verses what the total size of 
the file is.  So I am finding multiple modules on outoforder.cc needing to 
access this data and a clean solution would be so useful.

I'm going to try and add in an optional hook implementation and attach a patch 
up here.
Comment 3 Edward Rudd 2008-01-01 07:42:24 UTC
Created attachment 21335 [details]
Add in an optional hook along side optional function. 

This patch adds an optinal hook implementation so that multiple modules can
hook into the bytes out functionality.	I've also updated mod_logio to make use
of this hook.
*NOTE* I left the optional function in place so that compatability can be
maintained with old modules.. Also this patch should be able to backport to
apache 2.0 and 2.2 w/o issue.

Oh, why is there no OPTIONAL_HOOK that will run w/ a function that will return
void, Only w/ a return value?? that is the only *odd* change is that I have to
return OK from the function now.
Comment 4 Edward Rudd 2008-01-01 09:02:27 UTC
Comment on attachment 21335 [details]
Add in an optional hook along side optional function. 

Typos and odd linking issue that shouldn't occur.. ignore until I can fix it.
Comment 5 Edward Rudd 2008-01-03 19:04:37 UTC
Created attachment 21342 [details]
Updated patch

Updated tested patch from SVN trunk