aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-10-05 23:16:19 +0200
committerChristian Grothoff <christian@grothoff.org>2017-10-05 23:16:19 +0200
commit1a23dd25c36bdb0e0be264730e9088a49a1e8152 (patch)
tree0df4a2329e32c5908b6ffd9d5aa9eda2cd075a4c /src/microhttpd/connection.c
parent111e08fbe3f436bd21f78ab8c6c4c3b79e728bba (diff)
downloadlibmicrohttpd-1a23dd25c36bdb0e0be264730e9088a49a1e8152.tar.gz
libmicrohttpd-1a23dd25c36bdb0e0be264730e9088a49a1e8152.zip
misc style improvements, fixing some tiny rare memory leaks in examples
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index c33d484a..9b040418 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1070,7 +1070,7 @@ try_ready_normal_body (struct MHD_Connection *connection)
1070 * Prepare the response buffer of this connection for sending. 1070 * Prepare the response buffer of this connection for sending.
1071 * Assumes that the response mutex is already held. If the 1071 * Assumes that the response mutex is already held. If the
1072 * transmission is complete, this function may close the socket (and 1072 * transmission is complete, this function may close the socket (and
1073 * return MHD_NO). 1073 * return #MHD_NO).
1074 * 1074 *
1075 * @param connection the connection 1075 * @param connection the connection
1076 * @return #MHD_NO if readying the response failed 1076 * @return #MHD_NO if readying the response failed
@@ -1086,6 +1086,8 @@ try_ready_chunked_body (struct MHD_Connection *connection)
1086 int cblen; 1086 int cblen;
1087 1087
1088 response = connection->response; 1088 response = connection->response;
1089 if (NULL == response->crc)
1090 return MHD_YES;
1089 if (0 == connection->write_buffer_size) 1091 if (0 == connection->write_buffer_size)
1090 { 1092 {
1091 size = MHD_MIN (connection->daemon->pool_size, 1093 size = MHD_MIN (connection->daemon->pool_size,
@@ -3533,8 +3535,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
3533 socket_start_no_buffering (connection); 3535 socket_start_no_buffering (connection);
3534 continue; 3536 continue;
3535 } 3537 }
3536 if (NULL != connection->response->crc) 3538 MHD_mutex_unlock_chk_ (&connection->response->mutex);
3537 MHD_mutex_unlock_chk_ (&connection->response->mutex);
3538 break; 3539 break;
3539 case MHD_CONNECTION_BODY_SENT: 3540 case MHD_CONNECTION_BODY_SENT:
3540 if (MHD_NO == build_header_response (connection)) 3541 if (MHD_NO == build_header_response (connection))