mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-19 11:09:42 +00:00
Changed the order of handlers: protocol first, user second
This commit is contained in:
1 parent
dd6458262d
commit
0fc0230364
5 files changed
+25
-38
No files matched your search
+2
-4
@@ -16,11 +16,9 @@ void mg_call(struct mg_connection *c, int ev, void *ev_data) {
|
||||
MG_PROF_ADD(c, names[ev]);
|
||||
}
|
||||
#endif
|
||||
// Run user-defined handler first, in order to give it an ability
|
||||
// to intercept processing (e.g. clean input buffer) before the
|
||||
// protocol handler kicks in
|
||||
if (c->fn != NULL) c->fn(c, ev, ev_data);
|
||||
// Fire protocol handler first, user handler second. See #2559
|
||||
if (c->pfn != NULL) c->pfn(c, ev, ev_data);
|
||||
if (c->fn != NULL) c->fn(c, ev, ev_data);
|
||||
}
|
||||
|
||||
void mg_error(struct mg_connection *c, const char *fmt, ...) {
|
||||
|
||||
Reference in new issue
Block a user