MCPcopy Create free account
hub / github.com/davisking/dlib / read_body

Function read_body

dlib/server/server_http.cpp:301–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299// ----------------------------------------------------------------------------------------
300
301 void read_body (
302 std::istream& in,
303 incoming_things& incoming
304 )
305 {
306 // if the body hasn't already been loaded and there is data to load
307 if (incoming.body.size() == 0 &&
308 incoming.headers.count("Content-Length") != 0)
309 {
310 const unsigned long content_length = string_cast<unsigned long>(incoming.headers["Content-Length"]);
311
312 incoming.body.resize(content_length);
313 if (content_length > 0)
314 {
315 in.read(&incoming.body[0],content_length);
316 }
317 }
318 }
319
320// ----------------------------------------------------------------------------------------
321

Callers 2

on_connectMethod · 0.85
on_connectMethod · 0.85

Calls 4

countMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected