diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -32,7 +32,7 @@ static std::vectorsock, (const char*)buffer, size, 0); - if (res != size) { + ssize_t res = send(this->sock, request.data(), (int)request.size(), 0); + if (res != (ssize_t)request.size()) { /* Sending all data failed. Socket can't handle this little bit * of information? Just fall back to the old system! */ this->callback->OnFailure(); diff --git a/src/network/core/tcp_http.h b/src/network/core/tcp_http.h --- a/src/network/core/tcp_http.h +++ b/src/network/core/tcp_http.h @@ -61,7 +61,7 @@ public: void CloseSocket(); NetworkHTTPSocketHandler(SOCKET sock, HTTPCallback *callback, - const char *host, const char *url, const char *data, int depth); + const std::string &host, const char *url, const char *data, int depth); ~NetworkHTTPSocketHandler(); @@ -112,7 +112,7 @@ public: void OnConnect(SOCKET s) override { - new NetworkHTTPSocketHandler(s, this->callback, this->hostname.c_str(), this->url, this->data, this->depth); + new NetworkHTTPSocketHandler(s, this->callback, this->hostname, this->url, this->data, this->depth); /* We've relinquished control of data now. */ this->data = nullptr; }