mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Move HTTP_RESPONSE_CHUNK_SIZE into lambda for http response
This commit is contained in:
parent
b832e118cc
commit
145a8b385b
1 changed files with 1 additions and 1 deletions
|
@ -183,9 +183,9 @@ void HTTPConnection::respond(const char* code, std::unique_ptr<QIODevice> device
|
||||||
if (_responseDevice->atEnd()) {
|
if (_responseDevice->atEnd()) {
|
||||||
_socket->disconnectFromHost();
|
_socket->disconnectFromHost();
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t HTTP_RESPONSE_CHUNK_SIZE = 1024 * 10;
|
|
||||||
int totalToBeWritten = csize;
|
int totalToBeWritten = csize;
|
||||||
connect(_socket, &QTcpSocket::bytesWritten, this, [this, totalToBeWritten](size_t bytes) mutable {
|
connect(_socket, &QTcpSocket::bytesWritten, this, [this, totalToBeWritten](size_t bytes) mutable {
|
||||||
|
constexpr size_t HTTP_RESPONSE_CHUNK_SIZE = 1024 * 10;
|
||||||
if (!_responseDevice->atEnd()) {
|
if (!_responseDevice->atEnd()) {
|
||||||
totalToBeWritten -= _socket->write(_responseDevice->read(HTTP_RESPONSE_CHUNK_SIZE));
|
totalToBeWritten -= _socket->write(_responseDevice->read(HTTP_RESPONSE_CHUNK_SIZE));
|
||||||
if (_responseDevice->atEnd()) {
|
if (_responseDevice->atEnd()) {
|
||||||
|
|
Loading…
Reference in a new issue