mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +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,7 +2273,11 @@ static ssize_t Send(struct iovec *iov, int iovlen) {
|
|||
errno = 0;
|
||||
} else {
|
||||
LockInc(&shared->c.writeerrors);
|
||||
WARNF("(rsp) %s write error: %m", DescribeClient());
|
||||
if (errno == EBADF) { // don't warn on close/bad fd
|
||||
DEBUGF("(rsp) %s write badf", DescribeClient());
|
||||
} else {
|
||||
WARNF("(rsp) %s write error: %m", DescribeClient());
|
||||
}
|
||||
}
|
||||
connectionclose = true;
|
||||
}
|
||||
|
@ -5408,7 +5412,7 @@ static const char *DescribeClose(void) {
|
|||
if (killed) return "killed";
|
||||
if (meltdown) return "meltdown";
|
||||
if (terminated) return "terminated";
|
||||
if (connectionclose) return "connectionclose";
|
||||
if (connectionclose) return "connection closed";
|
||||
return "destroyed";
|
||||
}
|
||||
|
||||
|
@ -6311,15 +6315,19 @@ static void HandleMessages(void) {
|
|||
LockInc(&shared->c.readtimeouts);
|
||||
if (amtread) SendTimeout();
|
||||
NotifyClose();
|
||||
LogClose("readtimeout");
|
||||
LogClose("read timeout");
|
||||
return;
|
||||
} else if (errno == ECONNRESET) {
|
||||
LockInc(&shared->c.readresets);
|
||||
LogClose("readreset");
|
||||
LogClose("read reset");
|
||||
return;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
if (killed || (terminated && !amtread) ||
|
||||
|
|
Loading…
Reference in a new issue