Skip to content

Commit 6dba194

Browse files
authored
Fix a bug when EAGAIN on reading sockets (#182)
* Fix a bug when EAGAIN on reading sockets * remove ubuntu16.04 from CI
1 parent 6215b9a commit 6dba194

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/cmake.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ jobs:
6262
buildname: 'ubuntu-20.04/gcc'
6363
triplet: x64-linux
6464
compiler: gcc_64
65-
- os: ubuntu-16.04
66-
buildname: 'ubuntu-16.04/gcc'
67-
triplet: x64-linux
68-
compiler: gcc_64
65+
# - os: ubuntu-16.04
66+
# buildname: 'ubuntu-16.04/gcc'
67+
# triplet: x64-linux
68+
# compiler: gcc_64
6969
- os: macos-latest
7070
buildname: 'macos/clang'
7171
triplet: x64-osx

trantor/net/inner/TcpConnectionImpl.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,11 @@ void TcpConnectionImpl::readCallback()
552552
}
553553
else if (n < 0)
554554
{
555-
if (errno == EPIPE || errno == ECONNRESET) // TODO: any others?
555+
if (errno == EPIPE || errno == ECONNRESET ||
556+
errno == EAGAIN) // TODO: any others?
556557
{
557-
LOG_DEBUG << "EPIPE or ECONNRESET, errno=" << errno;
558+
LOG_DEBUG << "EPIPE or ECONNRESET, errno=" << errno
559+
<< " fd=" << socketPtr_->fd();
558560
return;
559561
}
560562
#ifdef _WIN32

0 commit comments

Comments
 (0)