aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 3952431c..b2fbbc43 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1107,15 +1107,15 @@ send_param_adapter (struct MHD_Connection *connection,
1107 /* can use sendfile */ 1107 /* can use sendfile */
1108 offset = (off_t) connection->response_write_position + connection->response->fd_off; 1108 offset = (off_t) connection->response_write_position + connection->response->fd_off;
1109 left = connection->response->total_size - connection->response_write_position; 1109 left = connection->response->total_size - connection->response_write_position;
1110 if (left > SSIZE_MAX) 1110 if (i > left)
1111 left = SSIZE_MAX; /* cap at return value limit */ 1111 i = left;
1112 if (-1 != (ret = sendfile (connection->socket_fd, 1112 if (0 < (ret = sendfile (connection->socket_fd,
1113 fd, 1113 fd,
1114 &offset, 1114 &offset,
1115 (size_t) left))) 1115 i)))
1116 { 1116 {
1117#if EPOLL_SUPPORT 1117#if EPOLL_SUPPORT
1118 if (ret < left) 1118 if (requested_size > (size_t) ret)
1119 { 1119 {
1120 /* partial write --- no longer write-ready */ 1120 /* partial write --- no longer write-ready */
1121 connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; 1121 connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;