Commit 421b420a authored by Alexander Alashkin's avatar Alexander Alashkin

Fix mp+keepalive combination

PUBLISHED_FROM=dbfcfa91ad85d6447726d0d7e9fe15709f4c4646
parent a478dc59
...@@ -4227,11 +4227,9 @@ static struct mg_http_proto_data *mg_http_get_proto_data( ...@@ -4227,11 +4227,9 @@ static struct mg_http_proto_data *mg_http_get_proto_data(
static void mg_http_free_proto_data_mp_stream( static void mg_http_free_proto_data_mp_stream(
struct mg_http_multipart_stream *mp) { struct mg_http_multipart_stream *mp) {
free((void *) mp->boundary); free((void *) mp->boundary);
mp->boundary = NULL;
free((void *) mp->var_name); free((void *) mp->var_name);
mp->var_name = NULL;
free((void *) mp->file_name); free((void *) mp->file_name);
mp->file_name = NULL; memset(mp, 0, sizeof(*mp));
} }
#endif #endif
...@@ -5267,6 +5265,7 @@ static void mg_http_multipart_begin(struct mg_connection *nc, ...@@ -5267,6 +5265,7 @@ static void mg_http_multipart_begin(struct mg_connection *nc,
*/ */
nc->flags |= MG_F_CLOSE_IMMEDIATELY; nc->flags |= MG_F_CLOSE_IMMEDIATELY;
} else { } else {
pd->mp_stream.state = MPS_BEGIN;
pd->mp_stream.boundary = strdup(boundary); pd->mp_stream.boundary = strdup(boundary);
pd->mp_stream.boundary_len = strlen(boundary); pd->mp_stream.boundary_len = strlen(boundary);
pd->mp_stream.var_name = pd->mp_stream.file_name = NULL; pd->mp_stream.var_name = pd->mp_stream.file_name = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment