summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-02-07 02:01:16 +0000
committerwollman <wollman@FreeBSD.org>1995-02-07 02:01:16 +0000
commit04d65ef905f991d5e2c573edcafa90962188a31c (patch)
tree894bc0776e1b0244cbdd83f51e33754df21302e2 /sys/kern/uipc_usrreq.c
parent3d44a439a93408cda21090051fd3092c61459b6f (diff)
downloadFreeBSD-src-04d65ef905f991d5e2c573edcafa90962188a31c.zip
FreeBSD-src-04d65ef905f991d5e2c573edcafa90962188a31c.tar.gz
Merge in the socket-level support for Transaction TCP.
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r--sys/kern/uipc_usrreq.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 18b1dfe..b856fee 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94
- * $Id: uipc_usrreq.c,v 1.4 1994/09/28 19:55:10 phk Exp $
+ * $Id: uipc_usrreq.c,v 1.5 1994/10/02 17:35:36 phk Exp $
*/
#include <sys/param.h>
@@ -172,6 +172,7 @@ uipc_usrreq(so, req, m, nam, control)
break;
case PRU_SEND:
+ case PRU_SEND_EOF:
if (control && (error = unp_internalize(control, p)))
break;
switch (so->so_type) {
@@ -212,6 +213,15 @@ uipc_usrreq(so, req, m, nam, control)
case SOCK_STREAM:
#define rcv (&so2->so_rcv)
#define snd (&so->so_snd)
+ /* Connect if not connected yet. */
+ /*
+ * Note: A better implementation would complain
+ * if already connected, nam non-zero and not
+ * equal to the peer's address.
+ */
+ if ((so->so_state & SS_ISCONNECTED) == 0 &&
+ (error = unp_connect(so, nam, p)) != 0)
+ break; /* XXX */
if (so->so_state & SS_CANTSENDMORE) {
error = EPIPE;
break;
@@ -243,6 +253,14 @@ uipc_usrreq(so, req, m, nam, control)
default:
panic("uipc 4");
}
+ /*
+ * SEND_EOF is equivalent to a SEND followed by
+ * a SHUTDOWN.
+ */
+ if (req == PRU_SEND_EOF) {
+ socantsendmore(so);
+ unp_shutdown(unp);
+ }
break;
case PRU_ABORT:
OpenPOWER on IntegriCloud