You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm trying to handler http request on single endpoint, so i specified handler like this:
mg_bind(m_mgr, port, nullptr); // i don't need handle other requests
mg_register_http_endpoint(m_conn, "/path", pathHandler);
mongoose fail with stack overflow when mg_call try to call default handler for HTTP mg_http_handler and so on
mg_call:
if (ev_handler == NULL) {
/*
* If protocol handler is specified, call it. Otherwise, call user-specified
* event handler.
*/
ev_handler = nc->proto_handler ? nc->proto_handler : nc->handler;
}
Before it resulted in an endless recursion.
Resolves#871
CL: Mongoose Web Server: Fail if passed a NULL handler to `mg_bind` or `mg_bind_opt`.
PUBLISHED_FROM=376e5d330a643fa530f6a27a422a1500f986c721
cesantabot
pushed a commit
to cesanta/mongoose-os
that referenced
this issue
Feb 2, 2018
Before it resulted in an endless recursion.
Resolvescesanta/mongoose#871
CL: Mongoose Web Server: Fail if passed a NULL handler to `mg_bind` or `mg_bind_opt`.
PUBLISHED_FROM=376e5d330a643fa530f6a27a422a1500f986c721
i'm trying to handler http request on single endpoint, so i specified handler like this:
mg_bind(m_mgr, port, nullptr); // i don't need handle other requests
mg_register_http_endpoint(m_conn, "/path", pathHandler);
mongoose fail with stack overflow when mg_call try to call default handler for HTTP mg_http_handler and so on
mg_call:
if (ev_handler == NULL) {
/*
* If protocol handler is specified, call it. Otherwise, call user-specified
* event handler.
*/
ev_handler = nc->proto_handler ? nc->proto_handler : nc->handler;
}
ev_handler(nc, ev, ev_data MG_UD_ARG(user_data)); // calling mg_http_handler
and in mg_http_handler we have:
mg_call(nc, nc->handler, nc->user_data, ev, ev_data);
not sure how it can be correctly resolved, but it seems strange that mg_http_handler can call parent function(mg_call)
The text was updated successfully, but these errors were encountered: