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

Function ReadAMFArray

src/brpc/amf.cpp:859–875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859bool ReadAMFArray(AMFArray* arr, AMFInputStream* stream) {
860 uint8_t marker;
861 if (stream->cut_u8(&marker) != 1u) {
862 LOG(ERROR) << "stream is not long enough";
863 return false;
864 }
865 if ((AMFMarker)marker == AMF_MARKER_STRICT_ARRAY) {
866 if (!ReadAMFArrayBody(arr, stream)) {
867 return false;
868 }
869 } else if ((AMFMarker)marker != AMF_MARKER_NULL) {
870 // NOTE: NULL is treated as an array w/o any items.
871 LOG(ERROR) << "Expected array/null, actually " << marker2str(marker);
872 return false;
873 }
874 return true;
875}
876
877// ======== AMFArray =========
878

Callers

nothing calls this directly

Calls 3

ReadAMFArrayBodyFunction · 0.85
marker2strFunction · 0.85
cut_u8Method · 0.80

Tested by

no test coverage detected