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

Method Feed

src/brpc/policy/rtmp_protocol.cpp:1155–1173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1153}
1154
1155ParseResult RtmpContext::Feed(butil::IOBuf* source, Socket* socket) {
1156 switch (_state) {
1157 case STATE_UNINITIALIZED:
1158 if (socket->CreatedByConnect()) {
1159 return WaitForS0S1(source, socket);
1160 } else {
1161 return WaitForC0C1orSimpleRtmp(source, socket);
1162 }
1163 case STATE_RECEIVED_S0S1:
1164 return WaitForS2(source, socket);
1165 case STATE_RECEIVED_C0C1:
1166 return WaitForC2(source, socket);
1167 case STATE_RECEIVED_S2:
1168 case STATE_RECEIVED_C2:
1169 return OnChunks(source, socket);
1170 }
1171 CHECK(false) << "Never here!";
1172 return MakeParseError(PARSE_ERROR_NO_RESOURCE);
1173}
1174
1175ParseResult RtmpContext::WaitForC0C1orSimpleRtmp(butil::IOBuf* source, Socket* socket) {
1176 if (source->length() < RTMP_HANDSHAKE_SIZE0 + MAGIC_NUMBER_SIZE) {

Callers 2

OnChunksMethod · 0.80
ParseRtmpMessageFunction · 0.80

Calls 15

MakeParseErrorFunction · 0.85
ReadBigEndian3BytesFunction · 0.85
ReadBigEndian4BytesFunction · 0.85
AddChunkFunction · 0.85
MakeMessageFunction · 0.85
CreatedByConnectMethod · 0.80
fetchMethod · 0.80
AddReceivedBytesMethod · 0.80
serviceMethod · 0.80
u_elapsedMethod · 0.80
sizeMethod · 0.45
is_validMethod · 0.45

Tested by

no test coverage detected