summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_sockbuf.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2000-06-20 01:09:23 +0000
committeralfred <alfred@FreeBSD.org>2000-06-20 01:09:23 +0000
commite3e72a583b17917255252eaad0aded3476d3652b (patch)
treeceab351ca57bd3ea52e7e08e2deff3f7092f493f /sys/kern/uipc_sockbuf.c
parent3cb8680a56e346f425143b8ca251f6d6161f13d4 (diff)
downloadFreeBSD-src-e3e72a583b17917255252eaad0aded3476d3652b.zip
FreeBSD-src-e3e72a583b17917255252eaad0aded3476d3652b.tar.gz
return of the accept filter part II
accept filters are now loadable as well as able to be compiled into the kernel. two accept filters are provided, one that returns sockets when data arrives the other when an http request is completed (doesn't work with 0.9 requests) Reviewed by: jmg
Diffstat (limited to 'sys/kern/uipc_sockbuf.c')
-rw-r--r--sys/kern/uipc_sockbuf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index 1026672..42e02a5 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -107,10 +107,21 @@ soisconnected(so)
struct socket *so;
{
struct socket *head = so->so_head;
+ int s;
so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING);
so->so_state |= SS_ISCONNECTED;
if (head && (so->so_state & SS_INCOMP)) {
+ if ((so->so_options & SO_ACCEPTFILTER) != 0) {
+ s = splnet();
+ so->so_upcall = head->so_accf->so_accept_filter->accf_callback;
+ so->so_upcallarg = head->so_accf->so_accept_filter_arg;
+ so->so_rcv.sb_flags |= SB_UPCALL;
+ so->so_options &= ~SO_ACCEPTFILTER;
+ splx(s);
+ so->so_upcall(so, so->so_upcallarg, 0);
+ return;
+ }
TAILQ_REMOVE(&head->so_incomp, so, so_list);
head->so_incqlen--;
so->so_state &= ~SS_INCOMP;
OpenPOWER on IntegriCloud