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

Function ReadAMFShortStringBody

src/brpc/amf.cpp:253–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253static bool ReadAMFShortStringBody(std::string* str, AMFInputStream* stream) {
254 uint16_t len = 0;
255 if (stream->cut_u16(&len) != 2u) {
256 LOG(ERROR) << "stream is not long enough";
257 return false;
258 }
259 str->resize(len);
260 if (len != 0 && stream->cutn(&(*str)[0], len) != len) {
261 LOG(ERROR) << "stream is not long enough";
262 return false;
263 }
264 return true;
265}
266
267static bool ReadAMFLongStringBody(std::string* str, AMFInputStream* stream) {
268 uint32_t len = 0;

Callers 6

ReadAMFStringFunction · 0.85
ReadAMFObjectFieldFunction · 0.85
ReadAMFObjectBodyFunction · 0.85
SkipAMFObjectBodyFunction · 0.85
ReadAMFEcmaArrayBodyFunction · 0.85
ReadAMFArrayItemFunction · 0.85

Calls 3

cut_u16Method · 0.80
resizeMethod · 0.45
cutnMethod · 0.45

Tested by

no test coverage detected