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

Function ReadAMFLongStringBody

src/brpc/amf.cpp:267–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267static bool ReadAMFLongStringBody(std::string* str, AMFInputStream* stream) {
268 uint32_t len = 0;
269 if (stream->cut_u32(&len) != 4u) {
270 LOG(ERROR) << "stream is not long enough";
271 return false;
272 }
273 str->resize(len);
274 if (len != 0 && stream->cutn(&(*str)[0], len) != len) {
275 LOG(ERROR) << "stream is not long enough";
276 return false;
277 }
278 return true;
279}
280
281bool ReadAMFString(std::string* str, AMFInputStream* stream) {
282 uint8_t marker;

Callers 3

ReadAMFStringFunction · 0.85
ReadAMFObjectFieldFunction · 0.85
ReadAMFArrayItemFunction · 0.85

Calls 3

cut_u32Method · 0.80
resizeMethod · 0.45
cutnMethod · 0.45

Tested by

no test coverage detected