Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/uipc_usrreq.c
Show First 20 Lines • Show All 1,168 Lines • ▼ Show 20 Lines | case SOCK_STREAM: | ||||
if (unp2->unp_flags & UNP_WANTCRED) { | if (unp2->unp_flags & UNP_WANTCRED) { | ||||
/* | /* | ||||
* Credentials are passed only once on SOCK_STREAM | * Credentials are passed only once on SOCK_STREAM | ||||
* and SOCK_SEQPACKET. | * and SOCK_SEQPACKET. | ||||
*/ | */ | ||||
unp2->unp_flags &= ~UNP_WANTCRED; | unp2->unp_flags &= ~UNP_WANTCRED; | ||||
control = unp_addsockcred(td, control); | control = unp_addsockcred(td, control); | ||||
} | } | ||||
/* | /* | ||||
* Send to paired receive port, and then reduce send buffer | * Send to paired receive port and wake up readers. Don't | ||||
* hiwater marks to maintain backpressure. Wake up readers. | * check for space available in the receive buffer if we're | ||||
* attaching ancillary data; Unix domain sockets only check | |||||
* for space in the sending sockbuf, and that check is | |||||
* performed one level up the stack. At that level we cannot | |||||
* precisely account for the amount of buffer space used | |||||
* (e.g., because control messages are not yet internalized). | |||||
*/ | */ | ||||
switch (so->so_type) { | switch (so->so_type) { | ||||
case SOCK_STREAM: | case SOCK_STREAM: | ||||
if (control != NULL) { | if (control != NULL) { | ||||
if (sbappendcontrol_locked(&so2->so_rcv, m, | sbappendcontrol_locked(&so2->so_rcv, m, | ||||
control)) | control); | ||||
control = NULL; | control = NULL; | ||||
} else | } else | ||||
sbappend_locked(&so2->so_rcv, m, flags); | sbappend_locked(&so2->so_rcv, m, flags); | ||||
break; | break; | ||||
case SOCK_SEQPACKET: { | case SOCK_SEQPACKET: { | ||||
const struct sockaddr *from; | const struct sockaddr *from; | ||||
from = &sun_noname; | from = &sun_noname; | ||||
/* | |||||
* Don't check for space available in so2->so_rcv. | |||||
* Unix domain sockets only check for space in the | |||||
* sending sockbuf, and that check is performed one | |||||
* level up the stack. | |||||
*/ | |||||
if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, | if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, | ||||
from, m, control)) | from, m, control)) | ||||
control = NULL; | control = NULL; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
mbcnt = so2->so_rcv.sb_mbcnt; | mbcnt = so2->so_rcv.sb_mbcnt; | ||||
sbcc = sbavail(&so2->so_rcv); | sbcc = sbavail(&so2->so_rcv); | ||||
if (sbcc) | if (sbcc) | ||||
▲ Show 20 Lines • Show All 1,609 Lines • Show Last 20 Lines |