mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-07 16:01:30 +00:00
Call MG_EV_ERROR with c->is_closing set
This commit is contained in:
1 parent
aa6d8b4662
commit
d0a6c111cb
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -399,9 +399,9 @@ void mg_error(struct mg_connection *c, const char *fmt, ...) {
|
|||||||
mg_vasprintf(&buf, sizeof(mem), fmt, ap);
|
mg_vasprintf(&buf, sizeof(mem), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
LOG(LL_ERROR, ("%lu %s", c->id, buf));
|
LOG(LL_ERROR, ("%lu %s", c->id, buf));
|
||||||
mg_call(c, MG_EV_ERROR, buf);
|
c->is_closing = 1; // Set is_closing before sending MG_EV_CALL
|
||||||
|
mg_call(c, MG_EV_ERROR, buf); // Let user handler to override it
|
||||||
if (buf != mem) free(buf);
|
if (buf != mem) free(buf);
|
||||||
c->is_closing = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MG_ENABLE_LINES
|
#ifdef MG_ENABLE_LINES
|
||||||
|
|||||||
+2
-2
@@ -18,7 +18,7 @@ void mg_error(struct mg_connection *c, const char *fmt, ...) {
|
|||||||
mg_vasprintf(&buf, sizeof(mem), fmt, ap);
|
mg_vasprintf(&buf, sizeof(mem), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
LOG(LL_ERROR, ("%lu %s", c->id, buf));
|
LOG(LL_ERROR, ("%lu %s", c->id, buf));
|
||||||
mg_call(c, MG_EV_ERROR, buf);
|
c->is_closing = 1; // Set is_closing before sending MG_EV_CALL
|
||||||
|
mg_call(c, MG_EV_ERROR, buf); // Let user handler to override it
|
||||||
if (buf != mem) free(buf);
|
if (buf != mem) free(buf);
|
||||||
c->is_closing = 1;
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user