It's always better to show the diff, rather than a block of code (it makes
it much clearer what you are doing):
@@ -1267,19 +1268,19 @@
if((theUser == NULL)
|| (theUser[0] == '\0'))
- strncpy(myUser, " ", 64);
+ strncpy(myUser, "-", 64);
else {
safe_snprintf(__FILE__, __LINE__, myUser, sizeof(myUser), " %s ",
theUser);
}
if(gzipBytesSent > 0)
- fprintf(myGlobals.accessLogFd, "%s -%s- [%s %s] - \"%s\" %d %u/%u
%lu\n",
+ fprintf(myGlobals.accessLogFd, "%s %s - [%s %s] \"%s\" %d %u/%u - -
%lu\n",
_addrtostr(requestFrom, buf, sizeof(buf)),
myUser, theDate, theZone,
httpRequestedURL, rc, gzipBytesSent, httpBytesSent,
msSpent);
else
- fprintf(myGlobals.accessLogFd, "%s -%s- [%s %s] - \"%s\" %d %u %lu\n",
+ fprintf(myGlobals.accessLogFd, "%s %s - [%s %s] \"%s\" %d %u - -
%lu\n",
_addrtostr(requestFrom, buf, sizeof(buf)),
myUser, theDate, theZone,
httpRequestedURL, rc, httpBytesSent,
Patches (I recommend using a unified diff, e.g. -U3) s/b sent as attachments
to [EMAIL PROTECTED]
It seems reasonable to me - any complaints?
-----Burton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Craig Humphrey
Sent: Wednesday, July 13, 2005 8:44 PM
To: Ntop Dev
Subject: [Ntop-dev] Change to http.c to be more compatable with webalizer
Not sure if I've posted this before, but I have to keep remembering to do
this (must create a proper diff patch!)...
This is from http.c, around line 1268 from the current CVS (well, a day or
two a go now I think).
I've just tweaked the access_log output slightly so that webalizer can
generate reports from it.
There are three changes, the first is to use a "-" instead of " " if the
username is null.
The other two are reformatting the twp fprintf patterns slightly to match
what I'm seeing from my Apache 2.0 server.
I've left the msSpent on the end, I don't think Webalizer knows about it, so
it ignores it.
Hopefully someone finds this useful.
Later'ish
Craig
if((theUser == NULL)
|| (theUser[0] == '\0'))
strncpy(myUser, "-", 64);
else {
safe_snprintf(__FILE__, __LINE__, myUser, sizeof(myUser), " %s ",
theUser);
}
if(gzipBytesSent > 0)
fprintf(myGlobals.accessLogFd, "%s %s - [%s %s] \"%s\" %d %u/%u - -
%lu\n",
_addrtostr(requestFrom, buf, sizeof(buf)),
myUser, theDate, theZone,
httpRequestedURL, rc, gzipBytesSent, httpBytesSent,
msSpent);
else
fprintf(myGlobals.accessLogFd, "%s %s - [%s %s] \"%s\" %d %u - -
%lu\n",
_addrtostr(requestFrom, buf, sizeof(buf)),
myUser, theDate, theZone,
httpRequestedURL, rc, httpBytesSent,
msSpent);
fflush(myGlobals.accessLogFd);
_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev
_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev