mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 13:37:34 +08:00
Call MG_EV_ERROR with c->is_closing set
This commit is contained in:
parent
aa6d8b4662
commit
d0a6c111cb
@ -399,9 +399,9 @@ void mg_error(struct mg_connection *c, const char *fmt, ...) {
|
||||
mg_vasprintf(&buf, sizeof(mem), fmt, ap);
|
||||
va_end(ap);
|
||||
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);
|
||||
c->is_closing = 1;
|
||||
}
|
||||
|
||||
#ifdef MG_ENABLE_LINES
|
||||
|
@ -18,7 +18,7 @@ void mg_error(struct mg_connection *c, const char *fmt, ...) {
|
||||
mg_vasprintf(&buf, sizeof(mem), fmt, ap);
|
||||
va_end(ap);
|
||||
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);
|
||||
c->is_closing = 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user