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

Function ReadAMFEcmaArrayBody

src/brpc/amf.cpp:552–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550}
551
552static bool ReadAMFEcmaArrayBody(google::protobuf::Message* message,
553 AMFInputStream* stream) {
554 uint32_t count = 0;
555 if (stream->cut_u32(&count) != 4u) {
556 LOG(ERROR) << "stream is not long enough";
557 return false;
558 }
559 const google::protobuf::Descriptor* desc = message->GetDescriptor();
560 std::string name;
561 for (uint32_t i = 0; i < count; ++i) {
562 if (!ReadAMFShortStringBody(&name, stream)) {
563 LOG(ERROR) << "Fail to read name from the stream";
564 return false;
565 }
566 const google::protobuf::FieldDescriptor* field = desc->FindFieldByName(name);
567 RPC_VLOG_IF(field == NULL) << "Unknown field=" << desc->full_name()
568 << "." << name;
569 if (!ReadAMFObjectField(stream, message, field)) {
570 return false;
571 }
572 }
573 return true;
574}
575
576bool ReadAMFObject(google::protobuf::Message* msg, AMFInputStream* stream) {
577 uint8_t marker;

Callers 3

ReadAMFObjectFunction · 0.85
ReadAMFObjectFieldFunction · 0.85
ReadAMFArrayItemFunction · 0.85

Calls 4

ReadAMFShortStringBodyFunction · 0.85
ReadAMFObjectFieldFunction · 0.85
cut_u32Method · 0.80
GetDescriptorMethod · 0.45

Tested by

no test coverage detected