diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/download.cpp | 12 | ||||
-rw-r--r-- | src/net/sdltcpnet.cpp | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp index 2abffba0c..d0c6515fc 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -541,14 +541,12 @@ void Download::prepareForm(curl_httppost **form, const std::string &fileName) curl_httppost *lastPtr = nullptr; std::ifstream file; - std::ostringstream str; - char *line = new char[10001]; - file.open(fileName.c_str(), std::ios::in); - if (!file.is_open()) return; + char *line = new char[10001]; + std::ostringstream str; while (file.getline(line, 10000)) str << line << "\n"; @@ -560,8 +558,10 @@ void Download::prepareForm(curl_httppost **form, const std::string &fileName) CURLFORM_END); } -size_t Download::writeFunction(void *ptr, size_t size, - size_t nmemb, void *stream) +size_t Download::writeFunction(void *ptr, + size_t size, + size_t nmemb, + void *stream A_UNUSED) { const size_t totalMem = size * nmemb; char *buf = new char[totalMem + 1]; diff --git a/src/net/sdltcpnet.cpp b/src/net/sdltcpnet.cpp index 7530e0f53..103620a5b 100644 --- a/src/net/sdltcpnet.cpp +++ b/src/net/sdltcpnet.cpp @@ -89,7 +89,9 @@ int TcpNet::resolveHost(IPaddress *const address, const char *const host, TcpNet::Socket TcpNet::open(IPaddress *const ip) { const TcpNet::Socket sock = SDLNet_TCP_Open(ip); -#ifndef __native_client__ +#if !defined(__native_client__) \ + || defined(TCP_THIN_LINEAR_TIMEOUTS) \ + || defined(TCP_THIN_DUPACK) if (sock && ip) { const TCPsocketHack *const hack |