diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-11 11:28:36 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-11 11:28:36 +0200 |
commit | 912181afd31184ae6739b927315d09c13a952f73 (patch) | |
tree | b0b16a8ebb9d3a3592307893f68d310207219af0 | |
parent | f4be5e015488659dc68dadbaca5a479e7b12d09c (diff) | |
download | libmicrohttpd-912181afd31184ae6739b927315d09c13a952f73.tar.gz libmicrohttpd-912181afd31184ae6739b927315d09c13a952f73.zip |
fix more warnings
-rw-r--r-- | src/examples/digest_auth_example.c | 9 | ||||
-rw-r--r-- | src/microhttpd/mhd_send.c | 8 | ||||
-rw-r--r-- | src/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 index e3edf206..073726ad 100644 --- a/src/examples/digest_auth_example.c +++ b/src/examples/digest_auth_example.c | |||
@@ -46,6 +46,7 @@ ahc_echo (void *cls, | |||
46 | char *username; | 46 | char *username; |
47 | const char *password = "testpass"; | 47 | const char *password = "testpass"; |
48 | const char *realm = "test@example.com"; | 48 | const char *realm = "test@example.com"; |
49 | int res; | ||
49 | enum MHD_Result ret; | 50 | enum MHD_Result ret; |
50 | (void) cls; /* Unused. Silent compiler warning. */ | 51 | (void) cls; /* Unused. Silent compiler warning. */ |
51 | (void) url; /* Unused. Silent compiler warning. */ | 52 | (void) url; /* Unused. Silent compiler warning. */ |
@@ -68,13 +69,13 @@ ahc_echo (void *cls, | |||
68 | MHD_destroy_response (response); | 69 | MHD_destroy_response (response); |
69 | return ret; | 70 | return ret; |
70 | } | 71 | } |
71 | ret = MHD_digest_auth_check (connection, realm, | 72 | res = MHD_digest_auth_check (connection, realm, |
72 | username, | 73 | username, |
73 | password, | 74 | password, |
74 | 300); | 75 | 300); |
75 | MHD_free (username); | 76 | MHD_free (username); |
76 | if ( (ret == MHD_INVALID_NONCE) || | 77 | if ( (res == MHD_INVALID_NONCE) || |
77 | (ret == MHD_NO) ) | 78 | (res == MHD_NO) ) |
78 | { | 79 | { |
79 | response = MHD_create_response_from_buffer (strlen (DENIED), | 80 | response = MHD_create_response_from_buffer (strlen (DENIED), |
80 | DENIED, | 81 | DENIED, |
@@ -84,7 +85,7 @@ ahc_echo (void *cls, | |||
84 | ret = MHD_queue_auth_fail_response (connection, realm, | 85 | ret = MHD_queue_auth_fail_response (connection, realm, |
85 | MY_OPAQUE_STR, | 86 | MY_OPAQUE_STR, |
86 | response, | 87 | response, |
87 | (ret == MHD_INVALID_NONCE) ? MHD_YES : | 88 | (res == MHD_INVALID_NONCE) ? MHD_YES : |
88 | MHD_NO); | 89 | MHD_NO); |
89 | MHD_destroy_response (response); | 90 | MHD_destroy_response (response); |
90 | return ret; | 91 | return ret; |
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c index fd6297aa..0864d532 100644 --- a/src/microhttpd/mhd_send.c +++ b/src/microhttpd/mhd_send.c | |||
@@ -357,7 +357,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, | |||
357 | else if (buffer_size > (size_t) ret) | 357 | else if (buffer_size > (size_t) ret) |
358 | connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; | 358 | connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; |
359 | #endif /* EPOLL_SUPPORT */ | 359 | #endif /* EPOLL_SUPPORT */ |
360 | if (ret == buffer_size) | 360 | if (buffer_size == (size_t) ret) |
361 | post_cork_setsockopt (connection, want_cork); | 361 | post_cork_setsockopt (connection, want_cork); |
362 | } | 362 | } |
363 | 363 | ||
@@ -398,7 +398,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection, | |||
398 | header, | 398 | header, |
399 | header_size, | 399 | header_size, |
400 | MHD_SSO_HDR_CORK); | 400 | MHD_SSO_HDR_CORK); |
401 | if ( (ret == header_size) && | 401 | if ( (header_size == (size_t) ret) && |
402 | (0 == buffer_size) && | 402 | (0 == buffer_size) && |
403 | connection->sk_cork_on) | 403 | connection->sk_cork_on) |
404 | { | 404 | { |
@@ -443,7 +443,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection, | |||
443 | 443 | ||
444 | /* Only if we succeeded sending the full buffer, we need to make sure that | 444 | /* Only if we succeeded sending the full buffer, we need to make sure that |
445 | the OS flushes at the end */ | 445 | the OS flushes at the end */ |
446 | if (ret == header_size + buffer_size) | 446 | if (header_size + buffer_size == (size_t) ret) |
447 | post_cork_setsockopt (connection, false); | 447 | post_cork_setsockopt (connection, false); |
448 | 448 | ||
449 | return ret; | 449 | return ret; |
@@ -665,7 +665,7 @@ MHD_send_sendfile_ (struct MHD_Connection *connection) | |||
665 | 665 | ||
666 | /* Make sure we send the data without delay ONLY if we | 666 | /* Make sure we send the data without delay ONLY if we |
667 | provided the complete response (not on partial write) */ | 667 | provided the complete response (not on partial write) */ |
668 | if (ret == left) | 668 | if (left == (uint64_t) ret) |
669 | post_cork_setsockopt (connection, false); | 669 | post_cork_setsockopt (connection, false); |
670 | 670 | ||
671 | return ret; | 671 | return ret; |
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c index 0069147b..9c464152 100644 --- a/src/microhttpd/postprocessor.c +++ b/src/microhttpd/postprocessor.c | |||
@@ -391,7 +391,7 @@ process_value (struct MHD_PostProcessor *pp, | |||
391 | pp->xbuf_pos = 0; | 391 | pp->xbuf_pos = 0; |
392 | if (NULL != last_escape) | 392 | if (NULL != last_escape) |
393 | { | 393 | { |
394 | if (value_end - last_escape < sizeof (pp->xbuf)) | 394 | if (((size_t) (value_end - last_escape)) < sizeof (pp->xbuf)) |
395 | { | 395 | { |
396 | pp->xbuf_pos = value_end - last_escape; | 396 | pp->xbuf_pos = value_end - last_escape; |
397 | memcpy (pp->xbuf, | 397 | memcpy (pp->xbuf, |