@@ -2064,20 +2064,33 @@ public void run() {
20642064 state .length -= nw ;
20652065 if (state .length == 0 ) {
20662066 remove (state );
2067- if (state .keepAlive ) {
2067+ switch (state .keepAliveState ) {
2068+ case NONE : {
2069+ // Close the socket since this is
2070+ // the end of the not keep-alive request.
2071+ closeSocket (state .socket );
2072+ break ;
2073+ }
2074+ case PIPELINED : {
20682075 // Destroy file descriptor pool, which should close the file
20692076 Pool .destroy (state .fdpool );
2070- Socket .timeoutSet (state .socket ,
2071- getConnectionTimeout () * 1000 );
2072- // If all done put the socket back in the
2073- // poller for processing of further requests
2074- getPoller ().add (
2075- state .socket , getKeepAliveTimeout (),
2077+ Socket .timeoutSet (state .socket , getConnectionTimeout () * 1000 );
2078+ // Process the pipelined request data
2079+ if (!processSocket (state .socket , SocketEvent .OPEN_READ )) {
2080+ closeSocket (state .socket );
2081+ }
2082+ break ;
2083+ }
2084+ case OPEN : {
2085+ // Destroy file descriptor pool, which should close the file
2086+ Pool .destroy (state .fdpool );
2087+ Socket .timeoutSet (state .socket , getConnectionTimeout () * 1000 );
2088+ // Put the socket back in the poller for
2089+ // processing of further requests
2090+ getPoller ().add (state .socket , getKeepAliveTimeout (),
20762091 Poll .APR_POLLIN );
2077- } else {
2078- // Close the socket since this is
2079- // the end of not keep-alive request.
2080- closeSocket (state .socket );
2092+ break ;
2093+ }
20812094 }
20822095 }
20832096 }
0 commit comments