diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-09-02 20:38:12 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-09-02 20:38:12 +0000 |
commit | e7d4d115566c113f2cba32f16857ea5e90c03be0 (patch) | |
tree | acc29e9bf0f255f5ade7780723e9101f4dcf5580 /nuttx/net/sendto.c | |
parent | a376ebf2a0c8b3b2d50eeb6be645311eb27579dd (diff) | |
download | px4-nuttx-e7d4d115566c113f2cba32f16857ea5e90c03be0.tar.gz px4-nuttx-e7d4d115566c113f2cba32f16857ea5e90c03be0.tar.bz2 px4-nuttx-e7d4d115566c113f2cba32f16857ea5e90c03be0.zip |
sendto.c
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@868 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/sendto.c')
-rw-r--r-- | nuttx/net/sendto.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c index 519510fe6..57c37668b 100644 --- a/nuttx/net/sendto.c +++ b/nuttx/net/sendto.c @@ -94,7 +94,7 @@ struct sendto_s ****************************************************************************/ #ifdef CONFIG_NET_UDP -uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvprivate, uint16 flags) +static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvprivate, uint16 flags) { struct sendto_s *pstate = (struct sendto_s *)pvprivate; @@ -111,12 +111,16 @@ uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvprivate, u } /* Check if the outgoing packet is available (it may have been claimed - * by a sendto interrupt serving a different thread. + * by a sendto interrupt serving a different thread -OR- if the output + * buffer currently contains unprocessed incoming data. In these cases + * we will just have to wait for the next polling cycle. */ - else if (dev->d_sndlen > 0) + else if (dev->d_sndlen > 0 || (flags & UIP_NEWDATA) != 0) { - /* Another thread has beat us sending data, wait for the next poll */ + /* Another thread has beat us sending data or the buffer is busy, + * wait for the next polling cycle + */ return flags; } |