| 349 | } |
| 350 | |
| 351 | QtHttpClientWrapper::ParsingStatus QtHttpClientWrapper::sendReplyToClient(QtHttpReply* reply) |
| 352 | { |
| 353 | if (reply != Q_NULLPTR) |
| 354 | { |
| 355 | if (!reply->useChunked()) |
| 356 | { |
| 357 | //reply->appendRawData (CRLF); |
| 358 | // send all headers and all data in one shot |
| 359 | reply->requestSendHeaders(); |
| 360 | reply->requestSendData(); |
| 361 | } |
| 362 | else |
| 363 | { |
| 364 | // last chunk |
| 365 | m_sockClient->write("0" % CRLF % CRLF); |
| 366 | m_sockClient->flush(); |
| 367 | } |
| 368 | |
| 369 | if (m_currentRequest != Q_NULLPTR) |
| 370 | { |
| 371 | static const QByteArray& CLOSE = QByteArrayLiteral("close"); |
| 372 | |
| 373 | if (m_currentRequest->getHeader(QtHttpHeader::Connection).toLower() == CLOSE) |
| 374 | { |
| 375 | // must close connection after this request |
| 376 | m_sockClient->close(); |
| 377 | } |
| 378 | |
| 379 | m_currentRequest->deleteLater(); |
| 380 | m_currentRequest = Q_NULLPTR; |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | return AwaitingRequest; |
| 385 | } |
| 386 |
nothing calls this directly
no test coverage detected