View | Details | Raw Unified | Return to bug 60409
Collapse All | Expand All

(-)java/org/apache/coyote/AbstractProtocol.java (-6 / +10 lines)
Lines 808-822 Link Here
808
                } else if (state == SocketState.OPEN) {
808
                } else if (state == SocketState.OPEN) {
809
                    // In keep-alive but between requests. OK to recycle
809
                    // In keep-alive but between requests. OK to recycle
810
                    // processor. Continue to poll for the next request.
810
                    // processor. Continue to poll for the next request.
811
                    connections.remove(socket);
811
                    if (connections.remove(socket) != null) {
812
                    release(processor);
812
                        release(processor);
813
                    }
813
                    wrapper.registerReadInterest();
814
                    wrapper.registerReadInterest();
814
                } else if (state == SocketState.SENDFILE) {
815
                } else if (state == SocketState.SENDFILE) {
815
                    // Sendfile in progress. If it fails, the socket will be
816
                    // Sendfile in progress. If it fails, the socket will be
816
                    // closed. If it works, the socket will be re-added to the
817
                    // closed. If it works, the socket will be re-added to the
817
                    // poller
818
                    // poller
818
                    connections.remove(socket);
819
                    if (connections.remove(socket) != null) {
819
                    release(processor);
820
                        release(processor);
821
                    }
820
                } else if (state == SocketState.UPGRADED) {
822
                } else if (state == SocketState.UPGRADED) {
821
                    // Don't add sockets back to the poller if this was a
823
                    // Don't add sockets back to the poller if this was a
822
                    // non-blocking write otherwise the poller may trigger
824
                    // non-blocking write otherwise the poller may trigger
Lines 829-835 Link Here
829
                } else {
831
                } else {
830
                    // Connection closed. OK to recycle the processor. Upgrade
832
                    // Connection closed. OK to recycle the processor. Upgrade
831
                    // processors are not recycled.
833
                    // processors are not recycled.
832
                    connections.remove(socket);
834
                    boolean releaseProcessor = connections.remove(socket) != null;
833
                    if (processor.isUpgrade()) {
835
                    if (processor.isUpgrade()) {
834
                        UpgradeToken upgradeToken = processor.getUpgradeToken();
836
                        UpgradeToken upgradeToken = processor.getUpgradeToken();
835
                        HttpUpgradeHandler httpUpgradeHandler = upgradeToken.getHttpUpgradeHandler();
837
                        HttpUpgradeHandler httpUpgradeHandler = upgradeToken.getHttpUpgradeHandler();
Lines 851-857 Link Here
851
                            }
853
                            }
852
                        }
854
                        }
853
                    } else {
855
                    } else {
854
                        release(processor);
856
                        if (releaseProcessor) {
857
                            release(processor);
858
                        }
855
                    }
859
                    }
856
                }
860
                }
857
                return state;
861
                return state;
(-)test/org/apache/catalina/connector/TestSendFile.java (-2 lines)
Lines 39-45 Link Here
39
import static org.junit.Assert.assertEquals;
39
import static org.junit.Assert.assertEquals;
40
40
41
import org.junit.Assert;
41
import org.junit.Assert;
42
import org.junit.Ignore;
43
import org.junit.Test;
42
import org.junit.Test;
44
43
45
import org.apache.catalina.Context;
44
import org.apache.catalina.Context;
Lines 157-163 Link Here
157
    }
156
    }
158
157
159
158
160
    @Ignore
161
    @Test
159
    @Test
162
    public void testBug60409() throws Exception {
160
    public void testBug60409() throws Exception {
163
        Tomcat tomcat = getTomcatInstance();
161
        Tomcat tomcat = getTomcatInstance();

Return to bug 60409