Handle ETIMEDOUT as connection close
parent
fd72f61f68
commit
3c2cef5f0d
|
@ -100,6 +100,7 @@ liNetworkStatus li_network_read(liVRequest *vr, int fd, liChunkQueue *cq) {
|
|||
#endif
|
||||
return len ? LI_NETWORK_STATUS_SUCCESS : LI_NETWORK_STATUS_WAIT_FOR_EVENT;
|
||||
case ECONNRESET:
|
||||
case ETIMEDOUT:
|
||||
return LI_NETWORK_STATUS_CONNECTION_CLOSE;
|
||||
default:
|
||||
VR_ERROR(vr, "oops, read from fd=%d failed: %s", fd, g_strerror(errno) );
|
||||
|
|
|
@ -28,6 +28,7 @@ static network_sendfile_result lighty_sendfile(liVRequest *vr, int fd, int filef
|
|||
return NSR_WAIT_FOR_EVENT;
|
||||
case ECONNRESET:
|
||||
case EPIPE:
|
||||
case ETIMEDOUT:
|
||||
return NSR_CLOSE;
|
||||
case EINTR:
|
||||
break; /* try again */
|
||||
|
@ -59,6 +60,7 @@ static network_sendfile_result lighty_sendfile(liVRequest *vr, int fd, int filef
|
|||
return NSR_WAIT_FOR_EVENT;
|
||||
case ENOTCONN:
|
||||
case EPIPE:
|
||||
case ETIMEDOUT:
|
||||
return NSR_CLOSE;
|
||||
case EINTR:
|
||||
if (r) {
|
||||
|
@ -95,6 +97,7 @@ static network_sendfile_result lighty_sendfile(liVRequest *vr, int fd, int filef
|
|||
case EAGAIN:
|
||||
return NSR_WAIT_FOR_EVENT;
|
||||
case EPIPE:
|
||||
case ETIMEDOUT:
|
||||
return NSR_CLOSE;
|
||||
case EINTR:
|
||||
break; /* try again */
|
||||
|
@ -125,6 +128,7 @@ static network_sendfile_result lighty_sendfile(liVRequest *vr, int fd, int filef
|
|||
return NSR_WAIT_FOR_EVENT;
|
||||
case ENOTCONN:
|
||||
case EPIPE:
|
||||
case ETIMEDOUT:
|
||||
return NSR_CLOSE;
|
||||
case EINTR:
|
||||
if (bytes) {
|
||||
|
|
|
@ -32,6 +32,7 @@ liNetworkStatus li_network_backend_write(liVRequest *vr, int fd, liChunkQueue *c
|
|||
return did_write_something ? LI_NETWORK_STATUS_SUCCESS : LI_NETWORK_STATUS_WAIT_FOR_EVENT;
|
||||
case ECONNRESET:
|
||||
case EPIPE:
|
||||
case ETIMEDOUT:
|
||||
return LI_NETWORK_STATUS_CONNECTION_CLOSE;
|
||||
default:
|
||||
VR_ERROR(vr, "oops, write to fd=%d failed: %s", fd, g_strerror(errno));
|
||||
|
|
|
@ -77,6 +77,7 @@ liNetworkStatus li_network_backend_writev(liVRequest *vr, int fd, liChunkQueue *
|
|||
goto cleanup;
|
||||
case ECONNRESET:
|
||||
case EPIPE:
|
||||
case ETIMEDOUT:
|
||||
res = LI_NETWORK_STATUS_CONNECTION_CLOSE;
|
||||
goto cleanup;
|
||||
case EINTR:
|
||||
|
|
Loading…
Reference in New Issue