MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / receiveBody

Function receiveBody

src/webInterface.cpp:178–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178bool receiveBody(httpd_req_t *req, String &body, size_t maxSize = 8192) {
179 if (req->content_len > maxSize) return false;
180 body = "";
181 body.reserve(req->content_len + 1);
182 size_t remaining = req->content_len;
183 while (remaining > 0) {
184 int readLen =
185 httpd_req_recv(req, reinterpret_cast<char *>(buff), remaining > bufSize ? bufSize : remaining);
186 if (readLen <= 0) return false;
187 body.concat(reinterpret_cast<const char *>(buff), readLen);
188 remaining -= readLen;
189 }
190 return true;
191}
192
193String multipartBoundary(const String &contentType) {
194 int idx = contentType.indexOf("boundary=");

Callers 3

readParamsFunction · 0.85
editfileHandlerFunction · 0.85
nvsHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected