Commit 4927195e authored by Alexander Alashkin's avatar Alexander Alashkin Committed by Marko Mikulicic

Use mongoose event to free updater resources

    PUBLISHED_FROM=3044287fe2623b591ddbf5c619398c21d6753411
parent 63be1ebd
......@@ -5072,15 +5072,16 @@ void mg_http_handler(struct mg_connection *nc, int ev, void *ev_data) {
*/
struct mg_http_stream_info si;
struct mg_http_multipart_part mp;
mg_event_handler_t handler;
memset(&mp, 0, sizeof(mp));
mg_http_parse_stream_info(&pd->strm_state, &si);
handler = mg_http_get_endpoint_handler(nc->listener, &si.endpoint);
mp.status = -1;
mp.var_name = si.var_name.p;
mp.file_name = si.file_name.p;
mg_call(nc, pd->endpoint_handler ? pd->endpoint_handler : nc->handler,
MG_EV_HTTP_PART_END, &mp);
mg_call(nc, (handler ? handler : nc->handler), MG_EV_HTTP_PART_END, &mp);
} else
#endif
if (io->len > 0 && mg_parse_http(io->buf, io->len, hm, is_req) > 0) {
......
......@@ -134,8 +134,10 @@
#endif
#include <assert.h>
#include <direct.h>
#include <errno.h>
#include <fcntl.h>
#include <io.h>
#include <limits.h>
#include <signal.h>
#include <stddef.h>
......@@ -143,8 +145,6 @@
#include <stdlib.h>
#include <sys/stat.h>
#include <time.h>
#include <direct.h>
#include <io.h>
#define random() rand()
#ifdef _MSC_VER
......@@ -839,7 +839,7 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
!(defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) && \
!(defined(__DARWIN_C_LEVEL) && __DARWIN_C_LEVEL >= 200809L) && \
!defined(RTOS_SDK)) && \
!(defined(_MSC_VER) && _MSC_VER >= 1600 /* MSVC2013+ has strnlen */)
!(defined(_MSC_VER) && _MSC_VER >= 1600 /* MSVC2010+ has strnlen */)
#define _MG_PROVIDE_STRNLEN
size_t strnlen(const char *s, size_t maxlen);
#endif
......
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