diff --git a/src/mhd2/conn_data_send.c b/src/mhd2/conn_data_send.c index f6945d92..d94a229a 100644 --- a/src/mhd2/conn_data_send.c +++ b/src/mhd2/conn_data_send.c @@ -98,7 +98,7 @@ mhd_conn_data_send (struct MHD_Connection *restrict c) + c->continue_message_write_offset, true, &sent); - if (mhd_SOCKET_ERR_NO_ERROR != res) + if (mhd_SOCKET_ERR_NO_ERROR == res) c->continue_message_write_offset += sent; } else if (MHD_CONNECTION_HEADERS_SENDING == c->state) @@ -233,10 +233,10 @@ mhd_conn_data_send (struct MHD_Connection *restrict c) if (mhd_SOCKET_ERR_NO_ERROR == res) { - if (mhd_REPLY_CNTN_LOC_CONN_BUF != c->rp.cntn_loc) - c->rp.rsp_cntn_read_pos += sent; - else + if (mhd_REPLY_CNTN_LOC_CONN_BUF == c->rp.cntn_loc) c->write_buffer_send_offset += sent; + else + c->rp.rsp_cntn_read_pos += sent; } if (MHD_CONNECTION_CHUNKED_BODY_READY == c->state) diff --git a/src/mhd2/stream_funcs.c b/src/mhd2/stream_funcs.c index cbd83ea3..3e88e6a4 100644 --- a/src/mhd2/stream_funcs.c +++ b/src/mhd2/stream_funcs.c @@ -719,9 +719,9 @@ mhd_conn_pre_close (struct MHD_Connection *restrict c, case mhd_SOCKET_ERR_NOTSOCK: case mhd_SOCKET_ERR_OTHER: case mhd_SOCKET_ERR_INTERNAL: + case mhd_SOCKET_ERR_NO_ERROR: term_code = MHD_REQUEST_TERMINATED_CONNECTION_ERROR; break; - case mhd_SOCKET_ERR_NO_ERROR: case mhd_SOCKET_ERR_AGAIN: case mhd_SOCKET_ERR_INTR: default: