Hello,
There are certain cases where connections probably ought to generate
access log entries but do not. Specifically if an ADP exits via
ns_adp_abort no access log entry will be generated, but data may have
been returned to the client. This seems like a bug.
The access log callback is registered via Ns_RegisterServerTrace. The
comments indicate that callbacks registered with this mechanism will
only be run if "the connection request procedure successfully responds
to the clients request." There is another callback procedure called
Ns_RegisterConnCleanup which will run its traces "at the end of
connection no matter the result code from the connection's request
procedure."
Switching the nslog code to use Ns_RegisterConnCleanup rather than
Ns_RegisterServerTrace seems to solve the case of the missing access log
entries. Does that seem like a reasonable thing to do? I'm not
familiar with the details of the various tracing hooks.
Trivial patch is attached.
-Andrew
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to
<[email protected]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.
Index: nslog/nslog.c
===================================================================
RCS file: /cvsroot/aolserver/aolserver/nslog/nslog.c,v
retrieving revision 1.16
diff -u -r1.16 nslog.c
--- nslog/nslog.c 8 Aug 2005 11:32:18 -0000 1.16
+++ nslog/nslog.c 26 Mar 2009 16:49:52 -0000
@@ -217,7 +217,7 @@
if (LogOpen(logPtr) != NS_OK) {
return NS_ERROR;
}
- Ns_RegisterServerTrace(server, LogTrace, logPtr);
+ Ns_RegisterConnCleanup(server, LogTrace, logPtr);
Ns_RegisterAtShutdown(LogCloseCallback, logPtr);
Ns_TclInitInterps(server, AddCmds, logPtr);
return NS_OK;