1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Make the operation of sonewconn1() a bit clearer by calling

pru_attach() before putting the new connection on the
connection queue.
This commit is contained in:
Garrett Wollman 1997-02-19 19:15:43 +00:00
parent 0495a9d2d7
commit b1396a353b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22936
2 changed files with 14 additions and 24 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
* $FreeBSD$
* $Id$
*/
#include <sys/param.h>
@ -222,6 +222,12 @@ sonewconn1(head, connstatus)
so->so_timeo = head->so_timeo;
so->so_pgid = head->so_pgid;
(void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0)) {
(void) free((caddr_t)so, M_SOCKET);
return ((struct socket *)0);
}
if (connstatus) {
TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
so->so_state |= SS_COMP;
@ -231,17 +237,6 @@ sonewconn1(head, connstatus)
head->so_incqlen++;
}
head->so_qlen++;
if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0)) {
if (so->so_state & SS_COMP) {
TAILQ_REMOVE(&head->so_comp, so, so_list);
} else {
TAILQ_REMOVE(&head->so_incomp, so, so_list);
head->so_incqlen--;
}
head->so_qlen--;
(void) free((caddr_t)so, M_SOCKET);
return ((struct socket *)0);
}
if (connstatus) {
sorwakeup(head);
wakeup((caddr_t)&head->so_timeo);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
* $FreeBSD$
* $Id$
*/
#include <sys/param.h>
@ -222,6 +222,12 @@ sonewconn1(head, connstatus)
so->so_timeo = head->so_timeo;
so->so_pgid = head->so_pgid;
(void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0)) {
(void) free((caddr_t)so, M_SOCKET);
return ((struct socket *)0);
}
if (connstatus) {
TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
so->so_state |= SS_COMP;
@ -231,17 +237,6 @@ sonewconn1(head, connstatus)
head->so_incqlen++;
}
head->so_qlen++;
if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0)) {
if (so->so_state & SS_COMP) {
TAILQ_REMOVE(&head->so_comp, so, so_list);
} else {
TAILQ_REMOVE(&head->so_incomp, so, so_list);
head->so_incqlen--;
}
head->so_qlen--;
(void) free((caddr_t)so, M_SOCKET);
return ((struct socket *)0);
}
if (connstatus) {
sorwakeup(head);
wakeup((caddr_t)&head->so_timeo);