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

Function parseContentLength

switch/source/server.cpp:167–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165 }
166
167 size_t parseContentLength(const std::string& headers)
168 {
169 // headerValue is case-insensitive, so every spelling a client may send is
170 // covered without listing them here.
171 std::string value = TransferProto::headerValue(headers, "Content-Length");
172 if (value.empty()) {
173 return 0;
174 }
175 return (size_t)strtoul(value.c_str(), nullptr, 10);
176 }
177
178 // Streams the body of an upload request to `tmpPath`, tracking progress and
179 // honouring a receive cancel. `leftover` is the body bytes already read while

Callers 1

handleHttpRequestFunction · 0.70

Calls 2

headerValueFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected