Merge pull request #45 from mutability/net-client-eof-handling
Detect client EOF properly. Handle EWOULDBLOCK.
This commit is contained in:
commit
65751ed6e9
3
net_io.c
3
net_io.c
|
@ -858,11 +858,12 @@ void modesReadFromClient(struct client *c, char *sep,
|
||||||
bContinue = 0;
|
bContinue = 0;
|
||||||
}
|
}
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
if ( (nread < 0) && (errno != EAGAIN)) { // Error, or end of file
|
if ( (nread < 0 && errno != EAGAIN && errno != EWOULDBLOCK) || nread == 0 ) { // Error, or end of file
|
||||||
#else
|
#else
|
||||||
if ( (nread < 0) && (errno != EWOULDBLOCK)) { // Error, or end of file
|
if ( (nread < 0) && (errno != EWOULDBLOCK)) { // Error, or end of file
|
||||||
#endif
|
#endif
|
||||||
modesFreeClient(c);
|
modesFreeClient(c);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (nread <= 0) {
|
if (nread <= 0) {
|
||||||
break; // Serve next client
|
break; // Serve next client
|
||||||
|
|
Loading…
Reference in a new issue