Only in lwip-mc: TAGS
diff -ru --exclude='*~*~' lwip/src/api/api_lib.c lwip-mc/src/api/api_lib.c
--- lwip/src/api/api_lib.c	2007-10-24 12:09:18.000000000 +0000
+++ lwip-mc/src/api/api_lib.c	2007-10-30 10:33:03.000000000 +0000
@@ -546,11 +546,14 @@
  * @param conn the TCP netconn over which to send data
  * @param dataptr pointer to the application buffer that contains the data to send
  * @param size size of the application data to send
- * @param copy flag: 1 = copy the data, 0 = data is non-volatile, can be sent by reference
+ * @param apiflags combination of following flags :
+ *  - NETCONN_MORE (0x02) for TCP connection, PSH flag will be set on last
+ * segment sent,
+ *  - NETCONN_COPY (0x01) data will be copied into memory belonging to the stack
  * @return ERR_OK if data was sent, any other err_t on error
  */
 err_t
-netconn_write(struct netconn *conn, const void *dataptr, int size, u8_t copy)
+netconn_write(struct netconn *conn, const void *dataptr, int size, u8_t apiflags)
 {
   struct api_msg msg;
 
@@ -560,7 +563,7 @@
   msg.function = do_write;
   msg.msg.conn = conn;
   msg.msg.msg.w.dataptr = dataptr;
-  msg.msg.msg.w.copy = copy;
+  msg.msg.msg.w.apiflags = apiflags;
   msg.msg.msg.w.len = size;
   /* For locking the core: this _can_ be delayed on low memory/low send buffer,
      but if it is, this is done inside api_msg.c:do_write(), so we can use the
diff -ru --exclude='*~*~' lwip/src/api/api_msg.c lwip-mc/src/api/api_msg.c
--- lwip/src/api/api_msg.c	2007-10-24 12:09:19.000000000 +0000
+++ lwip-mc/src/api/api_msg.c	2007-10-29 19:06:37.000000000 +0000
@@ -784,8 +784,10 @@
 #endif
   }
 
-  err = tcp_write(conn->pcb.tcp, dataptr, len, conn->write_msg->msg.w.copy);
-  LWIP_ASSERT("do_writemore: invalid length!", ((conn->write_offset + len) <= conn->write_msg->msg.w.len));
+  err = tcp_write(conn->pcb.tcp, dataptr, len,
+                  conn->write_msg->msg.w.apiflags);
+  LWIP_ASSERT("do_writemore: invalid length!",
+              ((conn->write_offset + len) <= conn->write_msg->msg.w.len));
   if (err == ERR_OK) {
     conn->write_offset += len;
     if (conn->write_offset == conn->write_msg->msg.w.len) {
diff -ru --exclude='*~*~' lwip/src/api/sockets.c lwip-mc/src/api/sockets.c
--- lwip/src/api/sockets.c	2007-10-10 08:13:58.000000000 +0000
+++ lwip-mc/src/api/sockets.c	2007-10-30 10:12:54.000000000 +0000
@@ -538,7 +538,8 @@
 #endif /* (LWIP_UDP || LWIP_RAW) */
   }
 
-  err = netconn_write(sock->conn, data, size, NETCONN_COPY);
+  err = netconn_write(sock->conn, data, size,
+                      NETCONN_COPY | ((flags & MSG_MORE) ? NETCONN_MORE : 0));
 
   LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_send(%d) err=%d size=%d\n", s, err, size));
   sock_set_errno(sock, err_to_errno(err));
diff -ru --exclude='*~*~' lwip/src/core/tcp_out.c lwip-mc/src/core/tcp_out.c
--- lwip/src/core/tcp_out.c	2007-09-07 23:02:00.000000000 +0000
+++ lwip-mc/src/core/tcp_out.c	2007-10-30 17:24:39.000000000 +0000
@@ -83,24 +83,27 @@
  * @param pcb Protocol control block of the TCP connection to enqueue data for.
  * @param data pointer to the data to send
  * @param len length (in bytes) of the data to send
- * @param copy 1 if data must be copied, 0 if data is non-volatile and can be
- * referenced.
+ * @param apiflags combination of following flags :
+ *  - TCP_WRITE_FLAG_MORE (0x02) for TCP connection, PSH flag will be set on last
+ * segment sent,
+ *  - TCP_WRITE_FLAG_COPY (0x01) data will be copied into memory belonging to the
+ * stack
  * @return ERR_OK if enqueued, another err_t on error
  * 
  * @see tcp_write()
  */
 err_t
-tcp_write(struct tcp_pcb *pcb, const void *data, u16_t len, u8_t copy)
+tcp_write(struct tcp_pcb *pcb, const void *data, u16_t len, u8_t apiflags)
 {
-  LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", copy=%"U16_F")\n", (void *)pcb,
-    data, len, (u16_t)copy));
+  LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n", (void *)pcb,
+    data, len, (u16_t)apiflags));
   /* connection is in valid state for data transmission? */
   if (pcb->state == ESTABLISHED ||
      pcb->state == CLOSE_WAIT ||
      pcb->state == SYN_SENT ||
      pcb->state == SYN_RCVD) {
     if (len > 0) {
-      return tcp_enqueue(pcb, (void *)data, len, 0, copy, NULL, 0);
+      return tcp_enqueue(pcb, (void *)data, len, 0, apiflags, NULL, 0);
     }
     return ERR_OK;
   } else {
@@ -118,15 +121,18 @@
  * @param arg Pointer to the data to be enqueued for sending.
  * @param len Data length in bytes
  * @param flags tcp header flags to set in the outgoing segment
- * @param copy 1 if data must be copied, 0 if data is non-volatile and can be
- * referenced.
+ * @param apiflags combination of following flags :
+ *  - TCP_WRITE_FLAG_MORE (0x02) for TCP connection, PSH flag will be set on last
+ * segment sent,
+ *  - TCP_WRITE_FLAG_COPY (0x01) data will be copied into memory belonging to the
+ * stack
  * @param optdata
  * @param optlen
  */
 err_t
 tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
-  u8_t flags, u8_t copy,
-  u8_t *optdata, u8_t optlen)
+            u8_t flags, u8_t apiflags,
+            u8_t *optdata, u8_t optlen)
 {
   struct pbuf *p;
   struct tcp_seg *seg, *useg, *queue;
@@ -135,8 +141,8 @@
   void *ptr;
   u16_t queuelen;
 
-  LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_enqueue(pcb=%p, arg=%p, len=%"U16_F", flags=%"X16_F", copy=%"U16_F")\n",
-    (void *)pcb, arg, len, (u16_t)flags, (u16_t)copy));
+  LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_enqueue(pcb=%p, arg=%p, len=%"U16_F", flags=%"X16_F", apiflags=%"U16_F")\n",
+    (void *)pcb, arg, len, (u16_t)flags, (u16_t)apiflags));
   LWIP_ERROR("tcp_enqueue: len == 0 || optlen == 0 (programmer violates API)",
       ((len == 0) || (optlen == 0)), return ERR_ARG;);
   LWIP_ERROR("tcp_enqueue: arg == NULL || optdata == NULL (programmer violates API)",
@@ -220,7 +226,7 @@
       seg->dataptr = seg->p->payload;
     }
     /* copy from volatile memory? */
-    else if (copy) {
+    else if (apiflags & TCP_WRITE_FLAG_COPY) {
       if ((seg->p = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_RAM)) == NULL) {
         LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue : could not allocate memory for pbuf copy size %"U16_F"\n", seglen));
         goto memerr;
@@ -372,7 +378,8 @@
 
   /* Set the PSH flag in the last segment that we enqueued, but only
   if the segment has data (indicated by seglen > 0). */
-  if (seg != NULL && seglen > 0 && seg->tcphdr != NULL) {
+  if (seg != NULL && seglen > 0 && seg->tcphdr != NULL &&
+      ! (apiflags & TCP_WRITE_FLAG_MORE)) {
     TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
   }
 
diff -ru --exclude='*~*~' lwip/src/include/lwip/api.h lwip-mc/src/include/lwip/api.h
--- lwip/src/include/lwip/api.h	2007-10-24 12:09:19.000000000 +0000
+++ lwip-mc/src/include/lwip/api.h	2007-10-30 17:22:51.000000000 +0000
@@ -54,8 +54,9 @@
  */
 
 /* Flags for netconn_write */
-#define NETCONN_NOCOPY 0x00
-#define NETCONN_COPY   0x01
+#define NETCONN_NONE    0x00
+#define NETCONN_COPY    TCP_WRITE_FLAG_COPY
+#define NETCONN_MORE    TCP_WRITE_FLAG_MORE
 
 /* Helpers to process several netconn_types by the same code */
 #define NETCONNTYPE_GROUP(t)    (t&0xF0)
@@ -164,7 +165,7 @@
            struct netbuf *buf);
 err_t             netconn_write   (struct netconn *conn,
            const void *dataptr, int size,
-           u8_t copy);
+           u8_t apiflags);
 err_t             netconn_close   (struct netconn *conn);
 
 #if LWIP_IGMP
diff -ru --exclude='*~*~' lwip/src/include/lwip/api_msg.h lwip-mc/src/include/lwip/api_msg.h
--- lwip/src/include/lwip/api_msg.h	2007-09-07 23:02:03.000000000 +0000
+++ lwip-mc/src/include/lwip/api_msg.h	2007-10-29 19:14:03.000000000 +0000
@@ -64,7 +64,7 @@
     struct {
       const void *dataptr;
       int len;
-      u8_t copy;
+      u8_t apiflags;
     } w; /* do_write */
     struct {
       u16_t len;
diff -ru --exclude='*~*~' lwip/src/include/lwip/sockets.h lwip-mc/src/include/lwip/sockets.h
--- lwip/src/include/lwip/sockets.h	2007-09-07 23:02:03.000000000 +0000
+++ lwip-mc/src/include/lwip/sockets.h	2007-10-30 16:08:27.000000000 +0000
@@ -132,7 +132,7 @@
 #define MSG_WAITALL    0x02    /* Requests that the function block until the full amount of data requested can be returned */
 #define MSG_OOB        0x04    /* Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */
 #define MSG_DONTWAIT   0x08    /* Nonblocking i/o for this operation only */
-
+#define MSG_MORE       0x10    /* Sender will send more */
 
 /*
  * Options for level IPPROTO_IP
diff -ru --exclude='*~*~' lwip/src/include/lwip/tcp.h lwip-mc/src/include/lwip/tcp.h
--- lwip/src/include/lwip/tcp.h	2007-10-09 19:59:59.000000000 +0000
+++ lwip-mc/src/include/lwip/tcp.h	2007-10-30 17:16:57.000000000 +0000
@@ -89,8 +89,10 @@
 struct tcp_pcb * tcp_listen  (struct tcp_pcb *pcb);
 void             tcp_abort   (struct tcp_pcb *pcb);
 err_t            tcp_close   (struct tcp_pcb *pcb);
+#define TCP_WRITE_FLAG_COPY   0x01
+#define TCP_WRITE_FLAG_MORE   0x02
 err_t            tcp_write   (struct tcp_pcb *pcb, const void *dataptr, u16_t len,
-                              u8_t copy);
+            u8_t apiflags);
 
 void             tcp_setprio (struct tcp_pcb *pcb, u8_t prio);
 
@@ -479,7 +481,7 @@
 
 err_t tcp_send_ctrl(struct tcp_pcb *pcb, u8_t flags);
 err_t tcp_enqueue(struct tcp_pcb *pcb, void *dataptr, u16_t len,
-    u8_t flags, u8_t copy,
+    u8_t flags, u8_t apiflags,
                 u8_t *optdata, u8_t optlen);
 
 void tcp_rexmit_seg(struct tcp_pcb *pcb, struct tcp_seg *seg);
