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; |