Don't count connections/requests from quiet hosts

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@20110 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2004-09-22 19:49:02 +00:00
parent f55c9b2690
commit 61b10196e0
2 changed files with 16 additions and 8 deletions

View file

@ -141,7 +141,10 @@
* <desc>An array of host IP addresses to refrain from logging ...
* this is useful if (for instance) you have a monitoring process which
* sends requests to the server to be sure it's alive, and don't want
* to log all the connections from this monitor.
* to log all the connections from this monitor.<br />
* Not only do we refrain from logging anything but exceptional events
* about these hosts, connections and requests by these hosts are not
* counted in statistics we generate.
* </desc>
* </deflist>
*/

View file

@ -1174,10 +1174,14 @@ unescapeData(const unsigned char* bytes, unsigned length, unsigned char *buf)
{
NSFileHandle *hdl = [session handle];
if (_verbose == YES && [_quiet containsObject: [session address]] == NO)
if ([_quiet containsObject: [session address]] == NO)
{
if (_verbose == YES)
{
NSLog(@"%@ disconnect", session);
}
_handled++;
}
[_nc removeObserver: self
name: NSFileHandleReadCompletionNotification
object: hdl];
@ -1192,7 +1196,6 @@ unescapeData(const unsigned char* bytes, unsigned length, unsigned char *buf)
[_listener acceptConnectionInBackgroundAndNotify];
_accepting = YES;
}
_handled++;
}
- (void) _process: (WebServerSession*)session
@ -1210,8 +1213,6 @@ unescapeData(const unsigned char* bytes, unsigned length, unsigned char *buf)
NSEnumerator *enumerator;
GSMimeHeader *hdr;
_requests++;
AUTORELEASE(RETAIN(session));
request = [[session parser] mimeDocument];
@ -1244,10 +1245,14 @@ unescapeData(const unsigned char* bytes, unsigned length, unsigned char *buf)
response = AUTORELEASE([GSMimeDocument new]);
[response setContent: [NSData data] type: @"text/plain" name: nil];
if (_verbose == YES && [_quiet containsObject: [session address]] == NO)
if ([_quiet containsObject: [session address]] == NO)
{
_requests++;
if (_verbose == YES)
{
NSLog(@"Request %@ - %@", session, request);
}
}
NS_DURING
{
[session setProcessing: YES];