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

Function ReadAMFString

src/brpc/amf.cpp:281–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281bool ReadAMFString(std::string* str, AMFInputStream* stream) {
282 uint8_t marker;
283 if (stream->cut_u8(&marker) != 1u) {
284 LOG(ERROR) << "stream is not long enough";
285 return false;
286 }
287 if ((AMFMarker)marker == AMF_MARKER_STRING) {
288 return ReadAMFShortStringBody(str, stream);
289 } else if ((AMFMarker)marker == AMF_MARKER_LONG_STRING) {
290 return ReadAMFLongStringBody(str, stream);
291 }
292 LOG(ERROR) << "Expected string, actually " << marker2str(marker);
293 return false;
294}
295
296bool ReadAMFBool(bool* val, AMFInputStream* stream) {
297 uint8_t marker;

Callers 10

TESTFunction · 0.85
LLVMFuzzerTestOneInputFunction · 0.85
ReadMethod · 0.85
OnDataMessageAMF0Method · 0.85
OnCommandMessageAMF0Method · 0.85
OnPlayMethod · 0.85
OnPublishMethod · 0.85
OnReleaseStreamMethod · 0.85
OnFCPublishMethod · 0.85
OnFCUnpublishMethod · 0.85

Calls 4

ReadAMFShortStringBodyFunction · 0.85
ReadAMFLongStringBodyFunction · 0.85
marker2strFunction · 0.85
cut_u8Method · 0.80

Tested by 1

TESTFunction · 0.68