MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / parseContentLength

Function parseContentLength

3ds/source/server.cpp:91–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 static size_t parseContentLength(const std::string& headers)
92 {
93 // headerValue is case-insensitive, so every spelling a client may send is
94 // covered without listing them here.
95 std::string value = TransferProto::headerValue(headers, "Content-Length");
96 if (value.empty()) {
97 return 0;
98 }
99 return (size_t)strtoul(value.c_str(), nullptr, 10);
100 }
101
102 // Per-recv idle timeout. The server is single-threaded, so without a bound a
103 // stalled (or malicious) client would hang the whole receiver indefinitely.

Callers 1

handleHttpRequestFunction · 0.70

Calls 2

headerValueFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected