The following reply was made to PR kern/154504; it has been noted by GNATS.

From: Mikolaj Golub <[email protected]>
To: Andrey Simonenko <[email protected]>
Cc: [email protected], [email protected],
    Pawel Jakub Dawidek <[email protected]>, Kostik Belousov <[email protected]>
Subject: Re: kern/154504: [libc] recv(2): PF_LOCAL stream connection is stuck 
in sbwait when recv(MSG_WAITALL) is used
Date: Sun, 10 Apr 2011 16:49:25 +0300

 --=-=-=
 
 Hi,
 
 Does the attached patch fix the problem for you?
 
 -- 
 Mikolaj Golub
 
 --=-=-=
 Content-Type: text/x-patch
 Content-Disposition: attachment; filename=uipc_socket.c.soreceive.patch
 
 Index: sys/kern/uipc_socket.c
 ===================================================================
 --- sys/kern/uipc_socket.c     (revision 220485)
 +++ sys/kern/uipc_socket.c     (working copy)
 @@ -1845,10 +1845,16 @@ dontblock:
                        }
                        SBLASTRECORDCHK(&so->so_rcv);
                        SBLASTMBUFCHK(&so->so_rcv);
 -                      error = sbwait(&so->so_rcv);
 -                      if (error) {
 -                              SOCKBUF_UNLOCK(&so->so_rcv);
 -                              goto release;
 +                      /*
 +                       * We could receive some data while was notifying the
 +                       * the protocol. Skip blocking in this case.
 +                       */
 +                      if (so->so_rcv.sb_mb == NULL) {
 +                              error = sbwait(&so->so_rcv);
 +                              if (error) {
 +                                      SOCKBUF_UNLOCK(&so->so_rcv);
 +                                      goto release;
 +                              }
                        }
                        m = so->so_rcv.sb_mb;
                        if (m != NULL)
 
 --=-=-=--
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to