Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Commit

Permalink
Fix HTTP request socket output (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakslice authored and alamminsalo committed Mar 28, 2019
1 parent 33fc3e8 commit 127664b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/network/httpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ void HttpServer::onRead() {

// Respond with 200
QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly);

// http payload message body
QByteArray content;
Expand All @@ -111,9 +110,7 @@ void HttpServer::onRead() {
response += "Content-Length: " + QString::number(content.length()) + "\n";
response += "\n" + content;

out << response.toUtf8();

socket->write(block);
socket->write(response.toUtf8());
socket->waitForBytesWritten();
socket->disconnectFromHost();

Expand Down

0 comments on commit 127664b

Please sign in to comment.