MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / addContentLength

Method addContentLength

Libraries/Http/HttpConnection.cpp:1001–1011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

999}
1000
1001Result HttpOutgoingMessage::addContentLength(uint64_t value)
1002{
1003 SC_TRY_MSG(not headersSent, "Headers already sent");
1004 SC_TRY_MSG(responseHeaders.writtenBytes() != 0, "startResponse or startRequest must be the first call");
1005 SC_TRY_MSG(not chunkedTransferEncodingEnabled and not transferEncodingAdded,
1006 "HttpOutgoingMessage does not support Content-Length with Transfer-Encoding");
1007 SC_TRY(responseHeaders.appendContentLength(value, "HttpOutgoingMessage::appendAscii - header space is finished",
1008 "HttpOutgoingMessage failed formatting Content-Length"));
1009 contentLengthAdded = true;
1010 return Result(true);
1011}
1012
1013Result HttpOutgoingMessage::setChunkedTransferEncoding()
1014{

Callers 6

receiveEchoBodyMethod · 0.80
handleRequestMethod · 0.80
getFileMethod · 0.80
sendEmptyResponseMethod · 0.80

Calls 1

ResultClass · 0.50

Tested by

no test coverage detected