]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CLEANUP] stream_sock: MSG_NOSIGNAL is only for send(), not recv()
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Jan 2010 09:26:13 +0000 (10:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jan 2010 09:26:13 +0000 (10:26 +0100)
We must not set this flag on recv(), it's not used, it's just for
send().

src/checks.c
src/stream_sock.c

index 79009612eef7b73b2c2dabeca3a01905d5eecfa1..ed5ca840627167e4a20c456585f0a7fbec0d72d8 100644 (file)
@@ -791,7 +791,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;
index 5caac469e7d906d4569530d2ffdbbc8515651016..d84cd1a29fc89932e76655aa795d74b5d74be450 100644 (file)
@@ -321,18 +321,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;