MCPcopy Index your code
hub / github.com/apache/tomcat / close

Method close

java/org/apache/coyote/http2/Stream.java:818–847  ·  view source on GitHub ↗
(Http2Exception http2Exception)

Source from the content-addressed store, hash-verified

816
817
818 final void close(Http2Exception http2Exception) {
819 if (http2Exception instanceof StreamException) {
820 try {
821 StreamException se = (StreamException) http2Exception;
822 if (log.isTraceEnabled()) {
823 log.trace(sm.getString("stream.reset.send", getConnectionId(), getIdAsString(), se.getError()));
824 }
825
826 // Need to update state atomically with the sending of the RST
827 // frame else other threads currently working with this stream
828 // may see the state change and send a RST frame before the RST
829 // frame triggered by this thread. If that happens the client
830 // may see out of order RST frames which may hard to follow if
831 // the client is unaware the RST frames may be received out of
832 // order.
833 handler.sendStreamReset(state, se);
834
835 cancelAllocationRequests();
836 inputBuffer.swallowUnread();
837 } catch (IOException ioe) {
838 ConnectionException ce =
839 new ConnectionException(sm.getString("stream.reset.fail", getConnectionId(), getIdAsString()),
840 Http2Error.PROTOCOL_ERROR, ioe);
841 handler.closeConnection(ce);
842 }
843 } else {
844 handler.closeConnection(http2Exception);
845 }
846 replace();
847 }
848
849
850 /*

Callers 1

upgradeDispatchMethod · 0.95

Calls 11

getConnectionIdMethod · 0.95
replaceMethod · 0.95
getIdAsStringMethod · 0.80
isTraceEnabledMethod · 0.65
traceMethod · 0.65
getStringMethod · 0.65
getErrorMethod · 0.45
sendStreamResetMethod · 0.45
swallowUnreadMethod · 0.45
closeConnectionMethod · 0.45

Tested by

no test coverage detected