diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-20 19:24:06 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-20 19:24:06 +0000 |
commit | 8cd8607510ca423089ca1b0266c22aeee685dcee (patch) | |
tree | 826e23653aecaf5f85d08ae94f3651a35634ace4 /nuttx/net/net-poll.c | |
parent | f4f6f592170662f664998c9a1ae938bda35cf8d9 (diff) | |
download | px4-nuttx-8cd8607510ca423089ca1b0266c22aeee685dcee.tar.gz px4-nuttx-8cd8607510ca423089ca1b0266c22aeee685dcee.tar.bz2 px4-nuttx-8cd8607510ca423089ca1b0266c22aeee685dcee.zip |
Add support for TCP/IP connection backlog
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1294 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/net-poll.c')
-rw-r--r-- | nuttx/net/net-poll.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/nuttx/net/net-poll.c b/nuttx/net/net-poll.c index 22bd03ce9..6dcb4c2d0 100644 --- a/nuttx/net/net-poll.c +++ b/nuttx/net/net-poll.c @@ -114,9 +114,9 @@ static uint16 poll_interrupt(struct uip_driver_s *dev, FAR void *conn, { pollevent_t eventset = 0; - /* Check for data availability events. */ + /* Check for data or connection availability events. */ - if ((flags & UIP_NEWDATA) != 0) + if ((flags & (UIP_NEWDATA|UIP_BACKLOG)) != 0) { eventset |= POLLIN & fds->events; } @@ -174,8 +174,7 @@ static inline int net_pollsetup(FAR struct socket *psock, struct pollfd *fds) #ifdef CONFIG_DEBUG if (!conn || !fds) { - ret = -EINVAL; - goto errout; + return -EINVAL; } #endif @@ -194,7 +193,7 @@ static inline int net_pollsetup(FAR struct socket *psock, struct pollfd *fds) /* Initialize the callbcack structure */ - cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT; + cb->flags = UIP_NEWDATA|UIP_BACKLOG|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT; cb->private = (FAR void *)fds; cb->event = poll_interrupt; @@ -219,7 +218,6 @@ static inline int net_pollsetup(FAR struct socket *psock, struct pollfd *fds) errout_with_irq: irqrestore(flags); -errout: return ret; } #endif /* HAVE_NETPOLL */ |