(Http2Exception http2Exception)
| 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 | /* |
no test coverage detected