| 550 | } |
| 551 | |
| 552 | static 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 | |
| 576 | bool ReadAMFObject(google::protobuf::Message* msg, AMFInputStream* stream) { |
| 577 | uint8_t marker; |
no test coverage detected