| version 1.66.4.2, 2002/11/08 09:31:35 |
version 1.67, 2002/06/10 20:43:16 |
| Line 1073 soreceive(struct socket *so, struct mbuf |
|
| Line 1073 soreceive(struct socket *so, struct mbuf |
|
| !sosendallatonce(so) && !nextrecord) { |
!sosendallatonce(so) && !nextrecord) { |
| if (so->so_error || so->so_state & SS_CANTRCVMORE) |
if (so->so_error || so->so_state & SS_CANTRCVMORE) |
| break; |
break; |
| /* |
|
| * If we are peeking and the socket receive buffer is |
|
| * full, stop since we can't get more data to peek at. |
|
| */ |
|
| if ((flags & MSG_PEEK) && sbspace(&so->so_rcv) <= 0) |
|
| break; |
|
| /* |
|
| * If we've drained the socket buffer, tell the |
|
| * protocol in case it needs to do something to |
|
| * get it filled again. |
|
| */ |
|
| if ((pr->pr_flags & PR_WANTRCVD) && so->so_pcb) |
|
| (*pr->pr_usrreq)(so, PRU_RCVD, |
|
| (struct mbuf *)0, |
|
| (struct mbuf *)(long)flags, |
|
| (struct mbuf *)0, |
|
| (struct proc *)0); |
|
| error = sbwait(&so->so_rcv); |
error = sbwait(&so->so_rcv); |
| if (error) { |
if (error) { |
| sbunlock(&so->so_rcv); |
sbunlock(&so->so_rcv); |