From 421b420a0c159a8cbd027f87674b19f4a9b77993 Mon Sep 17 00:00:00 2001 From: Alexander Alashkin Date: Wed, 29 Jun 2016 21:09:12 +0100 Subject: [PATCH] Fix mp+keepalive combination PUBLISHED_FROM=dbfcfa91ad85d6447726d0d7e9fe15709f4c4646 --- mongoose.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mongoose.c b/mongoose.c index 0645a1d3..8c251148 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4227,11 +4227,9 @@ static struct mg_http_proto_data *mg_http_get_proto_data( static void mg_http_free_proto_data_mp_stream( struct mg_http_multipart_stream *mp) { free((void *) mp->boundary); - mp->boundary = NULL; free((void *) mp->var_name); - mp->var_name = NULL; free((void *) mp->file_name); - mp->file_name = NULL; + memset(mp, 0, sizeof(*mp)); } #endif @@ -5267,6 +5265,7 @@ static void mg_http_multipart_begin(struct mg_connection *nc, */ nc->flags |= MG_F_CLOSE_IMMEDIATELY; } else { + pd->mp_stream.state = MPS_BEGIN; pd->mp_stream.boundary = strdup(boundary); pd->mp_stream.boundary_len = strlen(boundary); pd->mp_stream.var_name = pd->mp_stream.file_name = NULL;