aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 4e6fed5a..1a75eb28 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -314,10 +314,10 @@ connection_close_error (struct MHD_Connection *connection,
314 * sending. Assumes that the response mutex is 314 * sending. Assumes that the response mutex is
315 * already held. If the transmission is complete, 315 * already held. If the transmission is complete,
316 * this function may close the socket (and return 316 * this function may close the socket (and return
317 * MHD_NO). 317 * #MHD_NO).
318 * 318 *
319 * @param connection the connection 319 * @param connection the connection
320 * @return MHD_NO if readying the response failed 320 * @return #MHD_NO if readying the response failed
321 */ 321 */
322static int 322static int
323try_ready_normal_body (struct MHD_Connection *connection) 323try_ready_normal_body (struct MHD_Connection *connection)
@@ -364,10 +364,11 @@ try_ready_normal_body (struct MHD_Connection *connection)
364 { 364 {
365 /* either error or http 1.0 transfer, close socket! */ 365 /* either error or http 1.0 transfer, close socket! */
366 response->total_size = connection->response_write_position; 366 response->total_size = connection->response_write_position;
367 CONNECTION_CLOSE_ERROR (connection, 367 if (MHD_CONTENT_READER_END_OF_STREAM == ret)
368 (ret == MHD_CONTENT_READER_END_OF_STREAM) 368 MHD_connection_close (connection, MHD_REQUEST_TERMINATED_COMPLETD_OK);
369 ? "Closing connection (end of response)\n" 369 else
370 : "Closing connection (stream error)\n"); 370 CONNECTION_CLOSE_ERROR (connection,
371 "Closing connection (stream error)\n");
371 return MHD_NO; 372 return MHD_NO;
372 } 373 }
373 response->data_start = connection->response_write_position; 374 response->data_start = connection->response_write_position;