From 43ef9c65e05259f8566c99f7f3d410c0eef6fa25 Mon Sep 17 00:00:00 2001 From: Cowering Date: Sat, 4 Jul 2015 18:48:18 -0500 Subject: newest mongoose.. PRETTY sure I didn't alter anything (NW) --- 3rdparty/mongoose/examples/file_upload/file_upload.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '3rdparty/mongoose/examples/file_upload/file_upload.c') diff --git a/3rdparty/mongoose/examples/file_upload/file_upload.c b/3rdparty/mongoose/examples/file_upload/file_upload.c index f0c6a1a4238..eedfc837c57 100644 --- a/3rdparty/mongoose/examples/file_upload/file_upload.c +++ b/3rdparty/mongoose/examples/file_upload/file_upload.c @@ -7,23 +7,25 @@ static int send_index_page(struct mg_connection *conn) { const char *data; - int data_len, ofs = 0; + int data_len, n1, n2; char var_name[100], file_name[100]; mg_printf_data(conn, "%s", "Upload example." "
" - "
" + "
" + "
" "" "
"); - while ((ofs = mg_parse_multipart(conn->content + ofs, conn->content_len - ofs, - var_name, sizeof(var_name), - file_name, sizeof(file_name), - &data, &data_len)) > 0) { + n1 = n2 = 0; + while ((n2 = mg_parse_multipart(conn->content + n1, conn->content_len - n1, + var_name, sizeof(var_name), file_name, + sizeof(file_name), &data, &data_len)) > 0) { mg_printf_data(conn, "var: %s, file_name: %s, size: %d bytes
", var_name, file_name, data_len); + n1 += n2; } mg_printf_data(conn, "%s", ""); -- cgit v1.2.3-70-g09d2