diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/examples/demo.c | 4 | ||||
-rw-r--r-- | src/examples/digest_auth_example.c | 28 | ||||
-rw-r--r-- | src/examples/fileserver_example_external_select.c | 7 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 3 | ||||
-rw-r--r-- | src/microhttpd/digestauth.c | 2 |
6 files changed, 25 insertions, 22 deletions
@@ -1,3 +1,6 @@ | |||
1 | Sun Dec 22 14:54:30 CET 2013 | ||
2 | Adding a few lines to avoid warnings from picky compilers. -CG | ||
3 | |||
1 | Sat Dec 21 17:26:08 CET 2013 | 4 | Sat Dec 21 17:26:08 CET 2013 |
2 | Fixed an issue with a missing argument in the postexample. | 5 | Fixed an issue with a missing argument in the postexample. |
3 | Fixed issue with bogus offset increment involving sendfile | 6 | Fixed issue with bogus offset increment involving sendfile |
diff --git a/src/examples/demo.c b/src/examples/demo.c index 5ce1a244..d22f005b 100644 --- a/src/examples/demo.c +++ b/src/examples/demo.c | |||
@@ -258,7 +258,7 @@ list_directory (struct ResponseDataContext *rdc, | |||
258 | { | 258 | { |
259 | if ('.' == de->d_name[0]) | 259 | if ('.' == de->d_name[0]) |
260 | continue; | 260 | continue; |
261 | if (sizeof (fullname) <= | 261 | if (sizeof (fullname) <= (size_t) |
262 | snprintf (fullname, sizeof (fullname), | 262 | snprintf (fullname, sizeof (fullname), |
263 | "%s/%s", | 263 | "%s/%s", |
264 | dirname, de->d_name)) | 264 | dirname, de->d_name)) |
@@ -557,7 +557,7 @@ process_upload_data (void *cls, | |||
557 | uc->filename = strdup (fn); | 557 | uc->filename = strdup (fn); |
558 | } | 558 | } |
559 | if ( (0 != size) && | 559 | if ( (0 != size) && |
560 | (size != write (uc->fd, data, size)) ) | 560 | (size != (size_t) write (uc->fd, data, size)) ) |
561 | { | 561 | { |
562 | /* write failed; likely: disk full */ | 562 | /* write failed; likely: disk full */ |
563 | fprintf (stderr, | 563 | fprintf (stderr, |
diff --git a/src/examples/digest_auth_example.c b/src/examples/digest_auth_example.c index 51352022..a35fa8e5 100644 --- a/src/examples/digest_auth_example.c +++ b/src/examples/digest_auth_example.c | |||
@@ -47,41 +47,41 @@ ahc_echo (void *cls, | |||
47 | int ret; | 47 | int ret; |
48 | 48 | ||
49 | username = MHD_digest_auth_get_username(connection); | 49 | username = MHD_digest_auth_get_username(connection); |
50 | if (username == NULL) | 50 | if (username == NULL) |
51 | { | 51 | { |
52 | response = MHD_create_response_from_buffer(strlen (DENIED), | 52 | response = MHD_create_response_from_buffer(strlen (DENIED), |
53 | DENIED, | 53 | DENIED, |
54 | MHD_RESPMEM_PERSISTENT); | 54 | MHD_RESPMEM_PERSISTENT); |
55 | ret = MHD_queue_auth_fail_response(connection, realm, | 55 | ret = MHD_queue_auth_fail_response(connection, realm, |
56 | MY_OPAQUE_STR, | 56 | MY_OPAQUE_STR, |
57 | response, | 57 | response, |
58 | MHD_NO); | 58 | MHD_NO); |
59 | MHD_destroy_response(response); | 59 | MHD_destroy_response(response); |
60 | return ret; | 60 | return ret; |
61 | } | 61 | } |
62 | ret = MHD_digest_auth_check(connection, realm, | 62 | ret = MHD_digest_auth_check(connection, realm, |
63 | username, | 63 | username, |
64 | password, | 64 | password, |
65 | 300); | 65 | 300); |
66 | free(username); | 66 | free(username); |
67 | if ( (ret == MHD_INVALID_NONCE) || | 67 | if ( (ret == MHD_INVALID_NONCE) || |
68 | (ret == MHD_NO) ) | 68 | (ret == MHD_NO) ) |
69 | { | 69 | { |
70 | response = MHD_create_response_from_buffer(strlen (DENIED), | 70 | response = MHD_create_response_from_buffer(strlen (DENIED), |
71 | DENIED, | 71 | DENIED, |
72 | MHD_RESPMEM_PERSISTENT); | 72 | MHD_RESPMEM_PERSISTENT); |
73 | if (NULL == response) | 73 | if (NULL == response) |
74 | return MHD_NO; | 74 | return MHD_NO; |
75 | ret = MHD_queue_auth_fail_response(connection, realm, | 75 | ret = MHD_queue_auth_fail_response(connection, realm, |
76 | MY_OPAQUE_STR, | 76 | MY_OPAQUE_STR, |
77 | response, | 77 | response, |
78 | (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO); | 78 | (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO); |
79 | MHD_destroy_response(response); | 79 | MHD_destroy_response(response); |
80 | return ret; | 80 | return ret; |
81 | } | 81 | } |
82 | response = MHD_create_response_from_buffer(strlen(PAGE), PAGE, | 82 | response = MHD_create_response_from_buffer(strlen(PAGE), PAGE, |
83 | MHD_RESPMEM_PERSISTENT); | 83 | MHD_RESPMEM_PERSISTENT); |
84 | ret = MHD_queue_response(connection, MHD_HTTP_OK, response); | 84 | ret = MHD_queue_response(connection, MHD_HTTP_OK, response); |
85 | MHD_destroy_response(response); | 85 | MHD_destroy_response(response); |
86 | return ret; | 86 | return ret; |
87 | } | 87 | } |
@@ -91,7 +91,7 @@ main (int argc, char *const *argv) | |||
91 | { | 91 | { |
92 | int fd; | 92 | int fd; |
93 | char rnd[8]; | 93 | char rnd[8]; |
94 | size_t len; | 94 | ssize_t len; |
95 | size_t off; | 95 | size_t off; |
96 | struct MHD_Daemon *d; | 96 | struct MHD_Daemon *d; |
97 | 97 | ||
diff --git a/src/examples/fileserver_example_external_select.c b/src/examples/fileserver_example_external_select.c index 7a562e98..28d92303 100644 --- a/src/examples/fileserver_example_external_select.c +++ b/src/examples/fileserver_example_external_select.c | |||
@@ -134,12 +134,11 @@ main (int argc, char *const *argv) | |||
134 | if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) | 134 | if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) |
135 | break; /* fatal internal error */ | 135 | break; /* fatal internal error */ |
136 | if (MHD_get_timeout (d, &mhd_timeout) == MHD_YES) | 136 | if (MHD_get_timeout (d, &mhd_timeout) == MHD_YES) |
137 | |||
138 | { | 137 | { |
139 | if (tv.tv_sec * 1000 < mhd_timeout) | 138 | if (((MHD_UNSIGNED_LONG_LONG)tv.tv_sec) < mhd_timeout / 1000LL) |
140 | { | 139 | { |
141 | tv.tv_sec = mhd_timeout / 1000; | 140 | tv.tv_sec = mhd_timeout / 1000LL; |
142 | tv.tv_usec = (mhd_timeout - (tv.tv_sec * 1000)) * 1000; | 141 | tv.tv_usec = (mhd_timeout - (tv.tv_sec * 1000LL)) * 1000LL; |
143 | } | 142 | } |
144 | } | 143 | } |
145 | select (max + 1, &rs, &ws, &es, &tv); | 144 | select (max + 1, &rs, &ws, &es, &tv); |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index f43f071f..e66cd218 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1878,6 +1878,7 @@ MHD_get_timeout (struct MHD_Daemon *daemon, | |||
1878 | #endif | 1878 | #endif |
1879 | 1879 | ||
1880 | have_timeout = MHD_NO; | 1880 | have_timeout = MHD_NO; |
1881 | earliest_deadline = 0; /* avoid compiler warnings */ | ||
1881 | for (pos = daemon->manual_timeout_head; NULL != pos; pos = pos->nextX) | 1882 | for (pos = daemon->manual_timeout_head; NULL != pos; pos = pos->nextX) |
1882 | { | 1883 | { |
1883 | if (0 != pos->connection_timeout) | 1884 | if (0 != pos->connection_timeout) |
@@ -2457,7 +2458,7 @@ MHD_epoll (struct MHD_Daemon *daemon, | |||
2457 | #endif | 2458 | #endif |
2458 | return MHD_NO; | 2459 | return MHD_NO; |
2459 | } | 2460 | } |
2460 | for (i=0;i<num_events;i++) | 2461 | for (i=0;i<(unsigned int) num_events;i++) |
2461 | { | 2462 | { |
2462 | if (NULL == events[i].data.ptr) | 2463 | if (NULL == events[i].data.ptr) |
2463 | continue; /* shutdown signal! */ | 2464 | continue; /* shutdown signal! */ |
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 5cef1cfe..f67db9e3 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -258,7 +258,7 @@ lookup_sub_value (char *dest, | |||
258 | } | 258 | } |
259 | else | 259 | else |
260 | { | 260 | { |
261 | if (size > (q2 - q1) + 1) | 261 | if (size > (size_t) ((q2 - q1) + 1)) |
262 | size = (q2 - q1) + 1; | 262 | size = (q2 - q1) + 1; |
263 | size--; | 263 | size--; |
264 | memcpy (dest, | 264 | memcpy (dest, |