Browse code

tcp: fix for async write

- fixed bug in _wbufq_add() which caused packet corruption when
multiple packets with size < default buffer size where queued.

Reported-by: Vaclav Kubart, vaclav.kubart at iptel org
Tested-by: Vaclav Kubart, vaclav.kubart at iptel org

Andrei Pelinescu-Onciul authored on 12/12/2008 23:02:45
Showing 1 changed files
... ...
@@ -648,7 +648,7 @@ inline static int _wbufq_add(struct  tcp_connection* c, char* data,
648 648
 			last_free=wb->b_size;
649 649
 		}
650 650
 		crt_size=MIN_unsigned(last_free, size);
651
-		memcpy(wb->buf, data, crt_size);
651
+		memcpy(wb->buf+q->last_used, data, crt_size);
652 652
 		q->last_used+=crt_size;
653 653
 		size-=crt_size;
654 654
 		data+=crt_size;