summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-08 16:43:06 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-08 16:43:06 +0000
commit615e22af65c7efb223ba973c1b5aeaacdf5e7cdb (patch)
tree14f2dcc39e34773a3fb8260b5f906bf627231c70
parent2239a0abb6976e310df0eb3307f089fdb23a3bbf (diff)
downloadnuttx-615e22af65c7efb223ba973c1b5aeaacdf5e7cdb.tar.gz
nuttx-615e22af65c7efb223ba973c1b5aeaacdf5e7cdb.tar.bz2
nuttx-615e22af65c7efb223ba973c1b5aeaacdf5e7cdb.zip
Fix handling of callback result
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@379 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/configs/ntosd-dm320/netconfig8
-rw-r--r--nuttx/include/net/uip/uip.h5
-rw-r--r--nuttx/net/uip/uip-tcpappsend.c4
-rw-r--r--nuttx/net/uip/uip-tcpcallback.c4
4 files changed, 14 insertions, 7 deletions
diff --git a/nuttx/configs/ntosd-dm320/netconfig b/nuttx/configs/ntosd-dm320/netconfig
index e77eb15ed..f5e8e010e 100644
--- a/nuttx/configs/ntosd-dm320/netconfig
+++ b/nuttx/configs/ntosd-dm320/netconfig
@@ -63,7 +63,7 @@ CONFIG_DRAM_SIZE=0x01000000
CONFIG_DRAM_START=0x01000000
CONFIG_DRAM_VSTART=0x00000000
CONFIG_DRAM_NUTTXENTRY=0x01008000
-CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARCH_STACKDUMP=n
#
# DM320 specific device driver settings
@@ -270,14 +270,14 @@ CONFIG_PREALLOC_TIMERS=8
CONFIG_NET=y
CONFIG_NET_IPv6=n
CONFIG_NSOCKET_DESCRIPTORS=8
-CONFIG_NET_MAX_CONNECTIONS=40
-CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_MAX_CONNECTIONS=8
+CONFIG_NET_MAX_LISTENPORTS=8
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFFER_SIZE=420
CONFIG_NET_UDP=y
CONFIG_NET_UDP_CHECKSUMS=y
#CONFIG_NET_UDP_CONNS=10
-CONFIG_NET_STATISTICS=y
+CONFIG_NET_STATISTICS=n
#CONFIG_NET_PINGADDRCONF=0
#CONFIG_NET_RECEIVE_WINDOW=
#CONFIG_NET_ARPTAB_SIZE=8
diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/net/uip/uip.h
index 155f0e6a7..e002777c3 100644
--- a/nuttx/include/net/uip/uip.h
+++ b/nuttx/include/net/uip/uip.h
@@ -185,7 +185,10 @@ struct uip_conn
/* Higher level logic can retain application specific information
* in the following:
*
- * data_event() is called on all events.
+ * data_event() is called on all events. May return one of the following:
+ * UIP_CLOSE - Gracefully close the current connection
+ * UIP_ABORT - Abort (reset) the current connection on an error that
+ * prevents UIP_CLOSE from working.
* accept() is called when the TCP logic has created a connection
* connection_event() is called on any of the subset of connection-related events
*/
diff --git a/nuttx/net/uip/uip-tcpappsend.c b/nuttx/net/uip/uip-tcpappsend.c
index c0bbe8b48..63bad3fbd 100644
--- a/nuttx/net/uip/uip-tcpappsend.c
+++ b/nuttx/net/uip/uip-tcpappsend.c
@@ -98,6 +98,8 @@ void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn, uint8 resul
{
/* Handle the result based on the application response */
+ vdbg("result: %02x\n", result);
+
if (result & UIP_ABORT)
{
dev->d_sndlen = 0;
@@ -193,6 +195,8 @@ void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn, uint8 resul
void uip_tcprexmit(struct uip_driver_s *dev, struct uip_conn *conn, uint8 result)
{
+ vdbg("result: %02x\n", result);
+
dev->d_appdata = dev->d_snddata;
/* If the application has data to be sent, or if the incoming packet had
diff --git a/nuttx/net/uip/uip-tcpcallback.c b/nuttx/net/uip/uip-tcpcallback.c
index 4a314e997..524b70084 100644
--- a/nuttx/net/uip/uip-tcpcallback.c
+++ b/nuttx/net/uip/uip-tcpcallback.c
@@ -75,7 +75,7 @@
uint8 uip_tcpcallback(struct uip_driver_s *dev, struct uip_conn *conn, uint8 flags)
{
- uint8 ret = 0;
+ uint8 ret = flags & (UIP_ACKDATA|UIP_NEWDATA);
vdbg("flags: %02x\n", flags);
@@ -85,7 +85,7 @@ uint8 uip_tcpcallback(struct uip_driver_s *dev, struct uip_conn *conn, uint8 fla
{
/* Perform the callback */
- ret = conn->data_event(dev, conn, flags);
+ ret |= conn->data_event(dev, conn, flags);
}
/* Check if there is a connection-related event and a connection