mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-15 20:39:44 -04:00
[CLEANUP] stream_sock: MSG_NOSIGNAL is only for send(), not recv()
We must not set this flag on recv(), it's not used, it's just for
send().
(cherry picked from commit fc1daaf497)
This commit is contained in:
parent
a1a5950226
commit
014c4bcf19
2 changed files with 2 additions and 13 deletions
|
|
@ -454,7 +454,7 @@ static int event_srv_chk_r(int fd)
|
|||
* but the connection was closed on the remote end. Fortunately, recv still
|
||||
* works correctly and we don't need to do the getsockopt() on linux.
|
||||
*/
|
||||
len = recv(fd, trash, sizeof(trash), MSG_NOSIGNAL);
|
||||
len = recv(fd, trash, sizeof(trash), 0);
|
||||
if (unlikely(len < 0 && errno == EAGAIN)) {
|
||||
/* we want some polling to happen first */
|
||||
fdtab[fd].ev &= ~FD_POLL_IN;
|
||||
|
|
|
|||
|
|
@ -301,18 +301,7 @@ int stream_sock_read(int fd) {
|
|||
/*
|
||||
* 2. read the largest possible block
|
||||
*/
|
||||
if (MSG_NOSIGNAL) {
|
||||
ret = recv(fd, b->r, max, MSG_NOSIGNAL);
|
||||
} else {
|
||||
int skerr;
|
||||
socklen_t lskerr = sizeof(skerr);
|
||||
|
||||
ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &skerr, &lskerr);
|
||||
if (ret == -1 || skerr)
|
||||
ret = -1;
|
||||
else
|
||||
ret = recv(fd, b->r, max, 0);
|
||||
}
|
||||
ret = recv(fd, b->r, max, 0);
|
||||
|
||||
if (ret > 0) {
|
||||
b->r += ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue