From 82dbbb05b60924b7cc422b6f945facf7b558ca1b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 22 Jun 2014 13:34:09 -0600 Subject: [PATCH] Net: First bug fixes for modified write buffer logic --- ChangeLog | 3 +++ net/net_send_buffered.c | 3 ++- net/net_sockets.c | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e9b61b389f..fcccfd40f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7461,4 +7461,7 @@ * tools/mkfsdata.pl: Apparently, the trailing the 0x00 in http server files is seen as a bug in javascript and images. From Max/Himax (2014-6-19). + * net/ and include/nutt/net (many files): Conversion of the TCP + write buffering logic to use I/O buffer chains (not tested on initial + check-in) (2014-6-22). diff --git a/net/net_send_buffered.c b/net/net_send_buffered.c index 87f3d61d02..1584be8005 100644 --- a/net/net_send_buffered.c +++ b/net/net_send_buffered.c @@ -665,7 +665,7 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, } else { - FAR struct tcp_wrbuffer_s *wrb = tcp_wrbuffer_alloc(); + FAR struct tcp_wrbuffer_s *wrb; /* Set up the callback in the connection */ @@ -690,6 +690,7 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, */ sq_addlast(&wrb->wb_node, &conn->write_q); + nvdbg("Queued WRB=%p pktlen=%d\n", wrb, WRB_PKTLEN(wrb)); /* Notify the device driver of the availability of TX data */ diff --git a/net/net_sockets.c b/net/net_sockets.c index 5b3581c863..4885313566 100644 --- a/net/net_sockets.c +++ b/net/net_sockets.c @@ -105,6 +105,12 @@ void net_initialize(void) uip_initialize(); + /* Initialize I/O buffering */ + +#ifdef CONFIG_NET_IOB + iob_initialize(); +#endif + #ifdef CONFIG_NET_ROUTE /* Initialize the routing table */