MCPcopy Create free account
hub / github.com/apache/brpc / OnEndStream

Method OnEndStream

src/brpc/policy/http2_rpc_protocol.cpp:825–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823}
824
825H2ParseResult 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
848H2ParseResult H2Context::OnSettings(
849 butil::IOBufBytesIterator& it, const H2FrameHead& frame_head) {

Callers

nothing calls this directly

Calls 5

stateEnum · 0.85
H2StreamState2StrFunction · 0.85
MakeH2ErrorFunction · 0.85
MakeH2MessageFunction · 0.85

Tested by

no test coverage detected