]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Correctly set TCP_WRITE_FLAG_MORE when netconn_write is split into multiple calls...
authorgoldsimon <goldsimon>
Fri, 5 Mar 2010 11:34:43 +0000 (11:34 +0000)
committergoldsimon <goldsimon>
Fri, 5 Mar 2010 11:34:43 +0000 (11:34 +0000)
CHANGELOG
src/api/api_msg.c

index 6d6f6b0743f5f95b4e8a5da9c21c07c5ac2d42e5..627f0af942ecdb2312b357d028d8e595e33e6324 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -141,6 +141,10 @@ HISTORY
 
   ++ Bugfixes:
 
+  2010-03-05: Simon Goldschmidt
+  * api_msg.c: Correctly set TCP_WRITE_FLAG_MORE when netconn_write is split
+    into multiple calls to tcp_write.    
+
   2010-02-21: Simon Goldschmidt
   * opt.h, mem.h, dns.c: task #10140: Remove DNS_USES_STATIC_BUF (keep
     the implementation of DNS_USES_STATIC_BUF==1)
index 13ca299104fb3dbe79f15e92f835bf86808675c0..e33619237a648c12c9253d0dd711b919d94f8e7c 100644 (file)
@@ -1142,6 +1142,7 @@ do_writemore(struct netconn *conn)
   size_t diff;
   u8_t dontblock = netconn_is_nonblocking(conn) ||
        (conn->current_msg->msg.w.apiflags & NETCONN_DONTBLOCK);
+  u8_t apiflags = conn->current_msg->msg.w.apiflags;
 
   LWIP_ASSERT("conn != NULL", conn != NULL);
   LWIP_ASSERT("conn->state == NETCONN_WRITE", (conn->state == NETCONN_WRITE));
@@ -1157,6 +1158,7 @@ do_writemore(struct netconn *conn)
 #if LWIP_TCPIP_CORE_LOCKING
     conn->flags |= NETCONN_FLAG_WRITE_DELAYED;
 #endif
+    apiflags |= TCP_WRITE_FLAG_MORE;
   } else {
     len = (u16_t)diff;
   }
@@ -1167,6 +1169,7 @@ do_writemore(struct netconn *conn)
 #if LWIP_TCPIP_CORE_LOCKING
     conn->flags |= NETCONN_FLAG_WRITE_DELAYED;
 #endif
+    apiflags |= TCP_WRITE_FLAG_MORE;
   }
   if (dontblock && (len < conn->current_msg->msg.w.len)) {
     /* failed to send all data at once -> nonblocking write not possible */
@@ -1174,7 +1177,7 @@ do_writemore(struct netconn *conn)
   }
   if (err == ERR_OK) {
     LWIP_ASSERT("do_writemore: invalid length!", ((conn->write_offset + len) <= conn->current_msg->msg.w.len));
-    err = tcp_write(conn->pcb.tcp, dataptr, len, conn->current_msg->msg.w.apiflags);
+    err = tcp_write(conn->pcb.tcp, dataptr, len, apiflags);
   }
   if (dontblock && (err == ERR_MEM)) {
     /* nonblocking write failed */