MCPcopy Create free account
hub / github.com/MrKepzie/Natron / writeHead

Method writeHead

libs/qhttpserver/src/qhttpresponse.cpp:130–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void QHttpResponse::writeHead(int status)
131{
132 if (m_finished) {
133#ifdef DEBUG
134 qWarning() << "QHttpResponse::writeHead() Cannot write headers after response has finished.";
135#endif
136 return;
137 }
138
139 if (m_headerWritten) {
140#ifdef DEBUG
141 qWarning() << "QHttpResponse::writeHead() Already called once for this response.";
142#endif
143 return;
144 }
145
146 m_connection->write(
147 QString::fromUtf8("HTTP/1.1 %1 %2\r\n").arg(status).arg(STATUS_CODES[status]).toLatin1());
148 writeHeaders();
149 m_connection->write("\r\n");
150
151 m_headerWritten = true;
152}
153
154void QHttpResponse::writeHead(StatusCode statusCode)
155{

Callers 1

handlerMethod · 0.80

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected