aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>1995-02-07 02:01:16 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1995-02-07 02:01:16 +0000
commit6b8fda4d12c938e834161988da8e0f5c02ae8606 (patch)
tree894bc0776e1b0244cbdd83f51e33754df21302e2 /sys/kern/uipc_usrreq.c
parentc5c3febed7f4fa16edd03848f1580c9196409e70 (diff)
downloadsrc-6b8fda4d12c938e834161988da8e0f5c02ae8606.tar.gz
src-6b8fda4d12c938e834161988da8e0f5c02ae8606.zip
Notes
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 18b1dfedd4df..b856fee7e523 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: