diff --git a/src/AsyncSocket.h b/src/AsyncSocket.h index 1c416cd..61ee312 100644 --- a/src/AsyncSocket.h +++ b/src/AsyncSocket.h @@ -121,7 +121,7 @@ protected: int written = us_socket_write(SSL, (us_socket_t *) this, asyncSocketData->buffer.data(), asyncSocketData->buffer.length(), /*nextLength != 0 | */length); /* On failure return, otherwise continue down the function */ - if (written < asyncSocketData->buffer.length()) { + if ((unsigned int) written < asyncSocketData->buffer.length()) { /* Update buffering (todo: we can do better here if we keep track of what happens to this guy later on) */ asyncSocketData->buffer = asyncSocketData->buffer.substr(written); diff --git a/src/HttpContext.h b/src/HttpContext.h index ec3dc62..ae7ca05 100644 --- a/src/HttpContext.h +++ b/src/HttpContext.h @@ -236,7 +236,7 @@ private: AsyncSocket *asyncSocket = (AsyncSocket *) httpContextData->upgradedWebSocket; /* Uncork here as well (note: what if we failed to uncork and we then pub/sub before we even upgraded?) */ - auto [written, failed] = asyncSocket->uncork(); + /*auto [written, failed] = */asyncSocket->uncork(); /* Reset upgradedWebSocket before we return */ httpContextData->upgradedWebSocket = nullptr; @@ -276,7 +276,7 @@ private: } /* Drain any socket buffer, this might empty our backpressure and thus finish the request */ - auto [written, failed] = asyncSocket->write(nullptr, 0, true, 0); + /*auto [written, failed] = */asyncSocket->write(nullptr, 0, true, 0); /* Expect another writable event, or another request within the timeout */ asyncSocket->timeout(HTTP_IDLE_TIMEOUT_S); diff --git a/src/HttpParser.h b/src/HttpParser.h index c09be6d..62333a9 100644 --- a/src/HttpParser.h +++ b/src/HttpParser.h @@ -104,7 +104,7 @@ public: } std::string_view getQuery() { - if (querySeparator < headers->value.length()) { + if (querySeparator < (int) headers->value.length()) { /* Strip the initial ? */ return std::string_view(headers->value.data() + querySeparator + 1, headers->value.length() - querySeparator - 1); } else { @@ -117,7 +117,7 @@ public: } std::string_view getParameter(unsigned int index) { - if (currentParameters.first < index) { + if (currentParameters.first < (int) index) { return {}; } else { return currentParameters.second[index]; @@ -239,8 +239,8 @@ public: // this is exactly the same as below! // todo: refactor this - if (remainingStreamingBytes >= length) { - void *returnedUser = dataHandler(user, std::string_view(data, length), remainingStreamingBytes == length); + if (remainingStreamingBytes >= (unsigned int) length) { + void *returnedUser = dataHandler(user, std::string_view(data, length), remainingStreamingBytes == (unsigned int) length); remainingStreamingBytes -= length; return returnedUser; } else { @@ -280,8 +280,8 @@ public: if (remainingStreamingBytes) { // this is exactly the same as above! - if (remainingStreamingBytes >= length) { - void *returnedUser = dataHandler(user, std::string_view(data, length), remainingStreamingBytes == length); + if (remainingStreamingBytes >= (unsigned int) length) { + void *returnedUser = dataHandler(user, std::string_view(data, length), remainingStreamingBytes == (unsigned int) length); remainingStreamingBytes -= length; return returnedUser; } else { @@ -317,7 +317,7 @@ public: length -= consumed.first; if (length) { - if (length < MAX_FALLBACK_SIZE) { + if ((unsigned int) length < MAX_FALLBACK_SIZE) { fallback.append(data, length); } else { return errorHandler(user); diff --git a/src/HttpResponse.h b/src/HttpResponse.h index 3261757..c6aafa6 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -77,7 +77,7 @@ private: /* Called only once per request */ void writeMark() { - writeHeader("uWebSockets", "v0.16"); + writeHeader("uWebSockets", "v0.17"); } /* Returns true on success, indicating that it might be feasible to write more data. @@ -142,7 +142,7 @@ private: httpResponseData->offset += written; /* Success is when we wrote the entire thing without any failures */ - bool success = written == data.length() && !failed; + bool success = (unsigned int) written == data.length() && !failed; /* If we are now at the end, start a timeout. Also start a timeout if we failed. */ if (!success || httpResponseData->offset == totalSize) { diff --git a/src/WebSocketContextData.h b/src/WebSocketContextData.h index a88686f..d7e0af8 100644 --- a/src/WebSocketContextData.h +++ b/src/WebSocketContextData.h @@ -64,7 +64,7 @@ struct WebSocketContextData { /* Note: this assumes we are not corked, as corking will swallow things and fail later on */ /* Check if we now have too much backpressure (todo: don't buffer up before check) */ - if (asyncSocket->getBufferedAmount() > maxBackpressure) { + if ((unsigned int) asyncSocket->getBufferedAmount() > maxBackpressure) { asyncSocket->close(); } }