MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / write_data

Function write_data

src/runtime.cpp:59–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59static size_t write_data(char* ptr, size_t size, size_t nmemb, void* userdata)
60{
61 if (!ptr) {
62 return 0;
63 }
64
65 auto* const resp = static_cast<http::response*>(userdata);
66 assert(size == 1);
67 (void)size; // avoid warning in release builds
68 assert(resp);
69 resp->append_body(ptr, nmemb);
70 return nmemb;
71}
72
73// std::isspace has a few edge cases that would trigger UB. In particular, the documentation says:
74// "The behavior is undefined if the value of the input is not representable as unsigned char and is not equal to EOF."

Callers

nothing calls this directly

Calls 1

append_bodyMethod · 0.80

Tested by

no test coverage detected