MCPcopy Create free account
hub / github.com/apache/qpid-proton / decode_message_buffer

Function decode_message_buffer

c/benchmarks/message-encoding_list.cpp:44–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42const bool ERRORS = true;
43
44static void decode_message_buffer(pn_rwbytes_t data) {
45 pn_message_t *m = pn_message();
46 int err = pn_message_decode(m, data.start, data.size);
47 if (!err) {
48 /* Print the decoded message */
49 char *s = pn_tostring(pn_message_body(m));
50 if (VERBOSE) {
51 printf("%s\n", s);
52 fflush(stdout);
53 }
54 free(s);
55 pn_message_free(m);
56 free(data.start);
57 } else {
58 fprintf(stderr, "decode error: %s\n", pn_error_text(pn_message_error(m)));
59 exit(EXIT_FAILURE);
60 }
61}
62
63static void BM_EncodeListMessage(benchmark::State &state) {
64 if (VERBOSE)

Callers

nothing calls this directly

Calls 8

pn_messageFunction · 0.85
pn_message_bodyFunction · 0.85
pn_message_freeFunction · 0.85
pn_message_errorFunction · 0.85
exitFunction · 0.85
pn_message_decodeFunction · 0.50
pn_tostringFunction · 0.50
pn_error_textFunction · 0.50

Tested by

no test coverage detected