Fix a few warnings

This commit is contained in:
Alex Hultman
2019-12-26 16:45:23 +01:00
parent a969a3e53e
commit bdac60a177
5 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -236,7 +236,7 @@ private:
AsyncSocket<SSL> *asyncSocket = (AsyncSocket<SSL> *) 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);
+7 -7
View File
@@ -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);
+2 -2
View File
@@ -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) {
+1 -1
View File
@@ -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();
}
}