Skip to content

Commit 9dd3b75

Browse files
committed
Handle cesanta#1529 - do not mark normal conn termination as an error
1 parent 20fc8f0 commit 9dd3b75

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

mongoose.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3192,7 +3192,7 @@ static void iolog(struct mg_connection *c, char *buf, long n, bool r) {
31923192
if (n == 0) {
31933193
// Do nothing
31943194
} else if (n < 0) {
3195-
mg_error(c, "IO error");
3195+
c->is_closing = 1; // Termination. Don't call mg_error(): #1529
31963196
} else if (n > 0) {
31973197
if (c->is_hexdumping) {
31983198
union usa usa;

src/sock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void iolog(struct mg_connection *c, char *buf, long n, bool r) {
103103
if (n == 0) {
104104
// Do nothing
105105
} else if (n < 0) {
106-
mg_error(c, "IO error");
106+
c->is_closing = 1; // Termination. Don't call mg_error(): #1529
107107
} else if (n > 0) {
108108
if (c->is_hexdumping) {
109109
union usa usa;

0 commit comments

Comments
 (0)