libmicrohttpd

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

commit d98105b91b7ef63adf56fe808c92657fea927c59
parent c1115185b8c6f85bb51c6f0c20e8db69201a494b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue, 15 Dec 2020 22:09:00 +0300

Fixed compiler warning

Diffstat:
Msrc/microhttpd/mhd_send.c | 2+-
Msrc/microhttpd/response.c | 10+++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c @@ -858,7 +858,7 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection, (((size_t) SSIZE_MAX > header_size)) && (0 != body_size) ) { - int ret2; + ssize_t ret2; /* The header has been sent completely. * Try to send the reply body without waiting for * the next round. */ diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c @@ -546,9 +546,17 @@ pipe_reader (void *cls, ssize_t n; (void) pos; +#ifndef _WIN32 + if (SSIZE_MAX < max) + max = SSIZE_MAX; +#else /* _WIN32 */ + if (UINT_MAX < max) + max = UINT_MAX; +#endif /* _WIN32 */ + n = read (response->fd, buf, - max); + (MHD_SCKT_SEND_SIZE_) max); if (0 == n) return MHD_CONTENT_READER_END_OF_STREAM; if (n < 0)