@@ -68,6 +68,11 @@ void TcpConnectionImpl::readCallback()
68
68
}
69
69
else if (n < 0 )
70
70
{
71
+ if (errno == EPIPE || errno == ECONNRESET) // TODO: any others?
72
+ {
73
+ LOG_DEBUG << " EPIPE or ECONNRESET, erron=" << errno;
74
+ return ;
75
+ }
71
76
LOG_SYSERR << " read socket error" ;
72
77
}
73
78
extendLife ();
@@ -136,13 +141,12 @@ void TcpConnectionImpl::writeCallback()
136
141
}
137
142
else
138
143
{
139
- // error
140
144
if (errno != EWOULDBLOCK)
141
145
{
142
- LOG_SYSERR << " TcpConnectionImpl::sendInLoop" ;
143
- if (errno == EPIPE ||
144
- errno == ECONNRESET) // TODO: any others?
146
+ // TODO: any others?
147
+ if (errno == EPIPE || errno == ECONNRESET)
145
148
{
149
+ LOG_DEBUG << " EPIPE or ECONNRESET, erron=" << errno;
146
150
return ;
147
151
}
148
152
LOG_SYSERR << " Unexpected error(" << errno << " )" ;
@@ -183,13 +187,13 @@ void TcpConnectionImpl::writeCallback()
183
187
}
184
188
else
185
189
{
186
- // error
187
190
if (errno != EWOULDBLOCK)
188
191
{
189
- LOG_SYSERR << " TcpConnectionImpl::sendInLoop" ;
190
- if (errno == EPIPE ||
191
- errno == ECONNRESET) // TODO: any others?
192
+ // TODO: any others?
193
+ if (errno == EPIPE || errno == ECONNRESET)
192
194
{
195
+ LOG_DEBUG << " EPIPE or ECONNRESET, erron="
196
+ << errno;
193
197
return ;
194
198
}
195
199
LOG_SYSERR << " Unexpected error(" << errno
@@ -249,6 +253,8 @@ void TcpConnectionImpl::handleClose()
249
253
void TcpConnectionImpl::handleError ()
250
254
{
251
255
int err = _socketPtr->getSocketError ();
256
+ if (err == 0 )
257
+ return ;
252
258
if (err != 104 )
253
259
LOG_ERROR << " TcpConnectionImpl::handleError [" << _name
254
260
<< " ] - SO_ERROR = " << err << " " << strerror_tl (err);
@@ -321,6 +327,7 @@ void TcpConnectionImpl::sendInLoop(const char *buffer, size_t length)
321
327
{
322
328
if (errno == EPIPE || errno == ECONNRESET) // TODO: any others?
323
329
{
330
+ LOG_DEBUG << " EPIPE or ECONNRESET, erron=" << errno;
324
331
return ;
325
332
}
326
333
LOG_SYSERR << " Unexpected error(" << errno << " )" ;
@@ -711,10 +718,10 @@ void TcpConnectionImpl::sendFileInLoop(const BufferNodePtr &filePtr)
711
718
{
712
719
if (errno != EWOULDBLOCK)
713
720
{
714
- LOG_SYSERR << " TcpConnectionImpl::sendFileInLoop" ;
715
- if (errno == EPIPE ||
716
- errno == ECONNRESET) // TODO: any others?
721
+ // TODO: any others?
722
+ if (errno == EPIPE || errno == ECONNRESET)
717
723
{
724
+ LOG_DEBUG << " EPIPE or ECONNRESET, erron=" << errno;
718
725
return ;
719
726
}
720
727
LOG_SYSERR << " Unexpected error(" << errno << " )" ;
0 commit comments