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

Method OnCommandMessageAMF0

src/brpc/policy/rtmp_protocol.cpp:2270–2290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2268}
2269
2270bool RtmpChunkStream::OnCommandMessageAMF0(
2271 const RtmpMessageHeader& mh, butil::IOBuf* msg_body, Socket* socket) {
2272 butil::IOBufAsZeroCopyInputStream zc_stream(*msg_body);
2273 AMFInputStream istream(&zc_stream);
2274 std::string command_name;
2275 if (!ReadAMFString(&command_name, &istream)) {
2276 RTMP_ERROR(socket, mh) << "Fail to read commandName";
2277 return false;
2278 }
2279 RPC_VLOG << socket->remote_side() << "[" << mh.stream_id
2280 << "] Command{timestamp=" << mh.timestamp
2281 << " name=" << command_name << '}';
2282 pthread_once(&s_cmd_handlers_init_once, InitCommandHandlers);
2283 RtmpChunkStream::CommandHandler* phandler =
2284 s_cmd_handlers->seek(command_name);
2285 if (phandler == NULL) {
2286 RTMP_ERROR(socket, mh) << "Unknown command_name=" << command_name;
2287 return false;
2288 }
2289 return (this->**phandler)(mh, &istream, socket);
2290}
2291
2292bool RtmpChunkStream::OnDataMessageAMF3(
2293 const RtmpMessageHeader& mh, butil::IOBuf* msg_body, Socket* socket) {

Callers

nothing calls this directly

Calls 3

ReadAMFStringFunction · 0.85
remote_sideMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected