| 823 | } |
| 824 | |
| 825 | H2ParseResult H2StreamContext::OnEndStream() { |
| 826 | #if defined(BRPC_H2_STREAM_STATE) |
| 827 | if (state() == H2_STREAM_OPEN) { |
| 828 | SetState(H2_STREAM_HALF_CLOSED_REMOTE); |
| 829 | } else if (state() == H2_STREAM_HALF_CLOSED_LOCAL) { |
| 830 | SetState(H2_STREAM_CLOSED); |
| 831 | } else { |
| 832 | LOG(ERROR) << "Invalid state=" << H2StreamState2Str(_state) |
| 833 | << " in stream_id=" << stream_id(); |
| 834 | return MakeH2Error(H2_PROTOCOL_ERROR); |
| 835 | } |
| 836 | #endif |
| 837 | H2StreamContext* sctx = _conn_ctx->RemoveStreamAndDeferWU(stream_id()); |
| 838 | if (sctx == NULL) { |
| 839 | RPC_VLOG << "Fail to find stream_id=" << stream_id(); |
| 840 | return MakeH2Message(NULL); |
| 841 | } |
| 842 | CHECK_EQ(sctx, this); |
| 843 | |
| 844 | OnMessageComplete(); |
| 845 | return MakeH2Message(sctx); |
| 846 | } |
| 847 | |
| 848 | H2ParseResult H2Context::OnSettings( |
| 849 | butil::IOBufBytesIterator& it, const H2FrameHead& frame_head) { |
nothing calls this directly
no test coverage detected