diff -ru lwip-1.4.0/src/core/tcp.c lwip-1.4.0-minshall/src/core/tcp.c
--- lwip-1.4.0/src/core/tcp.c 2011-05-06 11:51:25.000000000 +0300
+++ lwip-1.4.0-minshall/src/core/tcp.c 2012-03-22 13:04:17.000000000 +0200
@@ -1228,6 +1228,7 @@
pcb->lastack = iss;
pcb->snd_lbb = iss;
pcb->tmr = tcp_ticks;
+
pcb->snd_sml = 0;
pcb->polltmr = 0;
diff -ru lwip-1.4.0/src/core/tcp_out.c lwip-1.4.0-minshall/src/core/tcp_out.c
--- lwip-1.4.0/src/core/tcp_out.c 2011-05-06 11:51:25.000000000 +0300
+++ lwip-1.4.0-minshall/src/core/tcp_out.c 2012-03-22 12:58:34.000000000 +0200
@@ -961,9 +961,16 @@
* RST is no sent using tcp_write/tcp_output.
*/
if((tcp_do_output_nagle(pcb) == 0) &&
- ((pcb->flags & (TF_NAGLEMEMERR | TF_FIN)) ==
0)){
- break;
+ ((pcb->flags & (TF_NAGLEMEMERR | TF_FIN)) == 0)){
+ if ( pcb->unacked && pcb->snd_sml > pcb->unacked->len) {
+ break;
+ }
+ else {
+ pcb->snd_sml = pcb->unsent? pcb->unsent->len : 0 + pcb->unsent->len;
+ }
}
+
+
#if
TCP_CWND_DEBUG
LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_output: snd_wnd %"U16_F", cwnd %"U16_F", wnd %"U32_F", effwnd %"U32_F", seq %"U32_F", ack %"U32_F", i %"S16_F"\n",
pcb->snd_wnd, pcb->cwnd, wnd,
diff -ru lwip-1.4.0/src/include/lwip/tcp.h lwip-1.4.0-minshall/src/include/lwip/tcp.h
--- lwip-1.4.0/src/include/lwip/tcp.h 2011-05-06 11:51:26.000000000 +0300
+++ lwip-1.4.0-minshall/src/include/lwip/tcp.h 2012-03-22 13:01:14.000000000 +0200
@@ -231,6 +231,8 @@
#define TCP_SNDQUEUELEN_OVERFLOW (0xffffU-3)
u16_t snd_queuelen; /* Available buffer space
for sending (in tcp_segs). */
+ u32_t snd_sml; /* Maintain state for minshall's algorithm */
+
#if TCP_OVERSIZE
/* Extra bytes available at the end of the last pbuf in unsent. */
u16_t unsent_oversize;