diff options
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r-- | src/microhttpd/connection.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 7fd52739..eda98f71 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -2958,6 +2958,8 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
2958 | { | 2958 | { |
2959 | const size_t wb_ready = connection->write_buffer_append_offset | 2959 | const size_t wb_ready = connection->write_buffer_append_offset |
2960 | - connection->write_buffer_send_offset; | 2960 | - connection->write_buffer_send_offset; |
2961 | mhd_assert (connection->write_buffer_append_offset > \ | ||
2962 | connection->write_buffer_send_offset); | ||
2961 | 2963 | ||
2962 | /* if the response body is not available, we use MHD_send_on_connection_() */ | 2964 | /* if the response body is not available, we use MHD_send_on_connection_() */ |
2963 | if (NULL != connection->response->crc) | 2965 | if (NULL != connection->response->crc) |
@@ -2987,7 +2989,8 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
2987 | "Connection was closed while sending response headers.\n")); | 2989 | "Connection was closed while sending response headers.\n")); |
2988 | return; | 2990 | return; |
2989 | } | 2991 | } |
2990 | if (ret > wb_ready) | 2992 | /* 'ret' is not negative, it's safe to cast it to 'size_t'. */ |
2993 | if (((size_t) ret) > wb_ready) | ||
2991 | { | 2994 | { |
2992 | mhd_assert (NULL == connection->response->crc); | 2995 | mhd_assert (NULL == connection->response->crc); |
2993 | /* We sent not just header data but also some response data, | 2996 | /* We sent not just header data but also some response data, |