Fix #1375 - change event processing order

This commit is contained in:
Sergey Lyubka committed 2021-10-31 12:40:56 +00:00
1 parent 3329047579
commit 03d187b147
2 files changed
+8 -2

No files matched your search

+4 -1
View File
@@ -385,8 +385,11 @@ void mg_resolve(struct mg_connection *c, struct mg_str *name, int ms) {
void mg_call(struct mg_connection *c, int ev, void *ev_data) {
if (c->pfn != NULL) c->pfn(c, ev, ev_data, c->pfn_data);
// 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, c->fn_data);
if (c->pfn != NULL) c->pfn(c, ev, ev_data, c->pfn_data);
}
void mg_error(struct mg_connection *c, const char *fmt, ...) {
+4 -1
View File
@@ -4,8 +4,11 @@
#include "util.h"
void mg_call(struct mg_connection *c, int ev, void *ev_data) {
if (c->pfn != NULL) c->pfn(c, ev, ev_data, c->pfn_data);
// 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, c->fn_data);
if (c->pfn != NULL) c->pfn(c, ev, ev_data, c->pfn_data);
}
void mg_error(struct mg_connection *c, const char *fmt, ...) {