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