MCPcopy Create free account
hub / github.com/ByConity/ByConity / send

Method send

src/Server/HTTP/HTTPServerResponse.cpp:27–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27std::shared_ptr<std::ostream> HTTPServerResponse::send()
28{
29 poco_assert(!stream);
30
31 if ((request && request->getMethod() == HTTPRequest::HTTP_HEAD) || getStatus() < 200 || getStatus() == HTTPResponse::HTTP_NO_CONTENT
32 || getStatus() == HTTPResponse::HTTP_NOT_MODIFIED)
33 {
34 Poco::CountingOutputStream cs;
35 write(cs);
36 stream = std::make_shared<Poco::Net::HTTPFixedLengthOutputStream>(session, cs.chars());
37 write(*stream);
38 }
39 else if (getChunkedTransferEncoding())
40 {
41 Poco::Net::HTTPHeaderOutputStream hs(session);
42 write(hs);
43 stream = std::make_shared<Poco::Net::HTTPChunkedOutputStream>(session);
44 }
45 else if (hasContentLength())
46 {
47 Poco::CountingOutputStream cs;
48 write(cs);
49 stream = std::make_shared<Poco::Net::HTTPFixedLengthOutputStream>(session, getContentLength64() + cs.chars());
50 write(*stream);
51 }
52 else
53 {
54 stream = std::make_shared<Poco::Net::HTTPOutputStream>(session);
55 setKeepAlive(false);
56 write(*stream);
57 }
58
59 return stream;
60}
61
62std::pair<std::shared_ptr<std::ostream>, std::shared_ptr<std::ostream>> HTTPServerResponse::beginSend()
63{

Callers 15

handleRequestMethod · 0.45
handleRequestMethod · 0.45
sendResultMethod · 0.45
handleRequestMethod · 0.45
handleRequestMethod · 0.45
authenticateUserMethod · 0.45
trySendExceptionToClientFunction · 0.45
runMethod · 0.45
startupMethod · 0.45

Calls 1

writeFunction · 0.50

Tested by

no test coverage detected