Author: rfm
Date: Wed Aug 19 14:19:21 2015
New Revision: 38912

URL: http://svn.gna.org/viewcvs/gnustep?rev=38912&view=rev
Log:
improve diagnostic output and fix bug dropping some connections prematurely

Modified:
    libs/webserver/trunk/ChangeLog
    libs/webserver/trunk/WebServer.m
    libs/webserver/trunk/WebServerConnection.m

Modified: libs/webserver/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/webserver/trunk/ChangeLog?rev=38912&r1=38911&r2=38912&view=diff
==============================================================================
--- libs/webserver/trunk/ChangeLog      (original)
+++ libs/webserver/trunk/ChangeLog      Wed Aug 19 14:19:21 2015
@@ -1,7 +1,13 @@
+2015-08-19 Richard Frith-Macdonald  <[email protected]>
+
+       * WebServerConnection.m: Don't delete close down connections just
+       because the per-thread count is exceeded ... we have a contract
+       with the client to keep those connections open.
+
 2015-08-18 Richard Frith-Macdonald  <[email protected]>
 
-       * WebServerConnection.mL Don't delete content-encoding header
-        which may have been set by the application.
+       * WebServerConnection.m: Don't delete content-encoding header
+       which may have been set by the application.
 
 2014-10-02 Sergei Golovin
 

Modified: libs/webserver/trunk/WebServer.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/webserver/trunk/WebServer.m?rev=38912&r1=38911&r2=38912&view=diff
==============================================================================
--- libs/webserver/trunk/WebServer.m    (original)
+++ libs/webserver/trunk/WebServer.m    Wed Aug 19 14:19:21 2015
@@ -989,12 +989,12 @@
   NSString     *result;
 
   [_lock lock];
-  result = [NSStringClass stringWithFormat:
-    @"%@ on %@(%@), %"PRIuPTR" of %"PRIuPTR" connections active,"
+  result = [NSStringClass stringWithFormat: @"%@ on %@(%@),"
+    @" %"PRIuPTR" of %"PRIuPTR"(%"PRIuPTR"/host) connections active,"
     @" %"PRIuPTR" ended, %"PRIuPTR" requests, listening: %@%@%@",
     [super description], _port, ([self isSecure] ? @"https" : @"http"),
-    [_connections count],
-    _maxConnections, _handled, _requests, _accepting == YES ? @"yes" : @"no",
+    [_connections count], _maxConnections, _maxPerHost,
+    _handled, _requests, _accepting == YES ? @"yes" : @"no",
     [self _ioThreadDescription], [self _poolDescription]];
   [_lock unlock];
   return result;
@@ -1527,7 +1527,7 @@
     {
       _maxPerHost = max;
     }
-  [_pool setOperations: max];
+  [_pool setOperations: _maxConnections];
 }
 
 - (void) setMaxConnectionsPerHost: (NSUInteger)max
@@ -1541,7 +1541,7 @@
       max = _maxConnections;
     }
   _maxPerHost = max;
-  [_pool setOperations: max];
+  [_pool setOperations: _maxConnections];
 }
 
 - (void) setMaxConnectionsReject: (BOOL)reject

Modified: libs/webserver/trunk/WebServerConnection.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/webserver/trunk/WebServerConnection.m?rev=38912&r1=38911&r2=38912&view=diff
==============================================================================
--- libs/webserver/trunk/WebServerConnection.m  (original)
+++ libs/webserver/trunk/WebServerConnection.m  Wed Aug 19 14:19:21 2015
@@ -907,7 +907,7 @@
 
           /* We will close this connection if the maximum number of requests
            * or maximum request duration has been exceeded or if the keepalive
-           * limit for the tthread has been reached.
+           * limit for the thread has been reached.
            */
           if (requests >= conf->maxConnectionRequests)
             {
@@ -1863,21 +1863,6 @@
 - (void) _keepalive
 {
   [ioThread->threadLock lock];
-  /* If we have hit the limit on keepalive connections,
-   * end older ones until we are back inside the limit.
-   */
-  while (ioThread->keepaliveCount >= ioThread->keepaliveMax)
-    {
-      WebServerConnection      *con;
-
-      con = (WebServerConnection*)ioThread->keepalives->head;
-      con->owner = nil;
-      GSLinkedListRemove(con, ioThread->keepalives);
-      ioThread->keepaliveCount--;
-      [ioThread->threadLock unlock];
-      [con end];
-      [ioThread->threadLock lock];
-    }
   if (owner != ioThread->keepalives)
     {
       GSLinkedListRemove(self, owner);


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to