libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 912181afd31184ae6739b927315d09c13a952f73
parent f4be5e015488659dc68dadbaca5a479e7b12d09c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 11 Apr 2020 11:28:36 +0200

fix more warnings

Diffstat:
Msrc/examples/digest_auth_example.c | 9+++++----
Msrc/microhttpd/mhd_send.c | 8++++----
Msrc/microhttpd/postprocessor.c | 2+-
3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/examples/digest_auth_example.c b/src/examples/digest_auth_example.c @@ -46,6 +46,7 @@ ahc_echo (void *cls, char *username; const char *password = "testpass"; const char *realm = "test@example.com"; + int res; enum MHD_Result ret; (void) cls; /* Unused. Silent compiler warning. */ (void) url; /* Unused. Silent compiler warning. */ @@ -68,13 +69,13 @@ ahc_echo (void *cls, MHD_destroy_response (response); return ret; } - ret = MHD_digest_auth_check (connection, realm, + res = MHD_digest_auth_check (connection, realm, username, password, 300); MHD_free (username); - if ( (ret == MHD_INVALID_NONCE) || - (ret == MHD_NO) ) + if ( (res == MHD_INVALID_NONCE) || + (res == MHD_NO) ) { response = MHD_create_response_from_buffer (strlen (DENIED), DENIED, @@ -84,7 +85,7 @@ ahc_echo (void *cls, ret = MHD_queue_auth_fail_response (connection, realm, MY_OPAQUE_STR, response, - (ret == MHD_INVALID_NONCE) ? MHD_YES : + (res == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO); MHD_destroy_response (response); return ret; diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c @@ -357,7 +357,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, else if (buffer_size > (size_t) ret) connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; #endif /* EPOLL_SUPPORT */ - if (ret == buffer_size) + if (buffer_size == (size_t) ret) post_cork_setsockopt (connection, want_cork); } @@ -398,7 +398,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection, header, header_size, MHD_SSO_HDR_CORK); - if ( (ret == header_size) && + if ( (header_size == (size_t) ret) && (0 == buffer_size) && connection->sk_cork_on) { @@ -443,7 +443,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection, /* Only if we succeeded sending the full buffer, we need to make sure that the OS flushes at the end */ - if (ret == header_size + buffer_size) + if (header_size + buffer_size == (size_t) ret) post_cork_setsockopt (connection, false); return ret; @@ -665,7 +665,7 @@ MHD_send_sendfile_ (struct MHD_Connection *connection) /* Make sure we send the data without delay ONLY if we provided the complete response (not on partial write) */ - if (ret == left) + if (left == (uint64_t) ret) post_cork_setsockopt (connection, false); return ret; diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c @@ -391,7 +391,7 @@ process_value (struct MHD_PostProcessor *pp, pp->xbuf_pos = 0; if (NULL != last_escape) { - if (value_end - last_escape < sizeof (pp->xbuf)) + if (((size_t) (value_end - last_escape)) < sizeof (pp->xbuf)) { pp->xbuf_pos = value_end - last_escape; memcpy (pp->xbuf,