mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-04-23 23:34:53 +00:00
Reduce redbean logging for EBADF (#461)
This may happen on explicitly closed client connections, so reduce the logging level similar to other errors.
This commit is contained in:
parent
059fe22ea3
commit
11ac8f11a9
1 changed files with 13 additions and 5 deletions
|
@ -2273,8 +2273,12 @@ static ssize_t Send(struct iovec *iov, int iovlen) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
} else {
|
} else {
|
||||||
LockInc(&shared->c.writeerrors);
|
LockInc(&shared->c.writeerrors);
|
||||||
|
if (errno == EBADF) { // don't warn on close/bad fd
|
||||||
|
DEBUGF("(rsp) %s write badf", DescribeClient());
|
||||||
|
} else {
|
||||||
WARNF("(rsp) %s write error: %m", DescribeClient());
|
WARNF("(rsp) %s write error: %m", DescribeClient());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
connectionclose = true;
|
connectionclose = true;
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -5408,7 +5412,7 @@ static const char *DescribeClose(void) {
|
||||||
if (killed) return "killed";
|
if (killed) return "killed";
|
||||||
if (meltdown) return "meltdown";
|
if (meltdown) return "meltdown";
|
||||||
if (terminated) return "terminated";
|
if (terminated) return "terminated";
|
||||||
if (connectionclose) return "connectionclose";
|
if (connectionclose) return "connection closed";
|
||||||
return "destroyed";
|
return "destroyed";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6311,15 +6315,19 @@ static void HandleMessages(void) {
|
||||||
LockInc(&shared->c.readtimeouts);
|
LockInc(&shared->c.readtimeouts);
|
||||||
if (amtread) SendTimeout();
|
if (amtread) SendTimeout();
|
||||||
NotifyClose();
|
NotifyClose();
|
||||||
LogClose("readtimeout");
|
LogClose("read timeout");
|
||||||
return;
|
return;
|
||||||
} else if (errno == ECONNRESET) {
|
} else if (errno == ECONNRESET) {
|
||||||
LockInc(&shared->c.readresets);
|
LockInc(&shared->c.readresets);
|
||||||
LogClose("readreset");
|
LogClose("read reset");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
LockInc(&shared->c.readerrors);
|
LockInc(&shared->c.readerrors);
|
||||||
WARNF("(clnt) %s readerror: %m", DescribeClient());
|
if (errno == EBADF) { // don't warn on close/bad fd
|
||||||
|
LogClose("read badf");
|
||||||
|
} else {
|
||||||
|
WARNF("(clnt) %s read error: %m", DescribeClient());
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (killed || (terminated && !amtread) ||
|
if (killed || (terminated && !amtread) ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue