@@ -2144,20 +2144,33 @@ public void run() {
21442144 state .length -= nw ;
21452145 if (state .length == 0 ) {
21462146 remove (state );
2147- if (state .keepAlive ) {
2147+ switch (state .keepAliveState ) {
2148+ case NONE : {
2149+ // Close the socket since this is
2150+ // the end of the not keep-alive request.
2151+ closeSocket (state .socket );
2152+ break ;
2153+ }
2154+ case PIPELINED : {
21482155 // Destroy file descriptor pool, which should close the file
21492156 Pool .destroy (state .fdpool );
2150- Socket .timeoutSet (state .socket ,
2151- getSoTimeout () * 1000 );
2152- // If all done put the socket back in the
2153- // poller for processing of further requests
2154- getPoller ().add (
2155- state .socket , getKeepAliveTimeout (),
2157+ Socket .timeoutSet (state .socket , getSoTimeout () * 1000 );
2158+ // Process the pipelined request data
2159+ if (!processSocket (state .socket , SocketEvent .OPEN_READ )) {
2160+ closeSocket (state .socket );
2161+ }
2162+ break ;
2163+ }
2164+ case OPEN : {
2165+ // Destroy file descriptor pool, which should close the file
2166+ Pool .destroy (state .fdpool );
2167+ Socket .timeoutSet (state .socket , getSoTimeout () * 1000 );
2168+ // Put the socket back in the poller for
2169+ // processing of further requests
2170+ getPoller ().add (state .socket , getKeepAliveTimeout (),
21562171 Poll .APR_POLLIN );
2157- } else {
2158- // Close the socket since this is
2159- // the end of not keep-alive request.
2160- closeSocket (state .socket );
2172+ break ;
2173+ }
21612174 }
21622175 }
21632176 }
0 commit comments