mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-02-22 19:31:36 +00:00
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:
parent
f55c9b2690
commit
61b10196e0
2 changed files with 16 additions and 8 deletions
|
@ -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>
|
||||
*/
|
||||
|
|
19
WebServer.m
19
WebServer.m
|
@ -1174,9 +1174,13 @@ 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)
|
||||
{
|
||||
NSLog(@"%@ disconnect", session);
|
||||
if (_verbose == YES)
|
||||
{
|
||||
NSLog(@"%@ disconnect", session);
|
||||
}
|
||||
_handled++;
|
||||
}
|
||||
[_nc removeObserver: self
|
||||
name: NSFileHandleReadCompletionNotification
|
||||
|
@ -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,9 +1245,13 @@ 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)
|
||||
{
|
||||
NSLog(@"Request %@ - %@", session, request);
|
||||
_requests++;
|
||||
if (_verbose == YES)
|
||||
{
|
||||
NSLog(@"Request %@ - %@", session, request);
|
||||
}
|
||||
}
|
||||
NS_DURING
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue