2
0
Эх сурвалжийг харах

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 16 жил өмнө
parent
commit
74c6d2807c
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      tcp_main.c

+ 1 - 1
tcp_main.c

@@ -648,7 +648,7 @@ inline static int _wbufq_add(struct  tcp_connection* c, char* data,
 			last_free=wb->b_size;
 		}
 		crt_size=MIN_unsigned(last_free, size);
-		memcpy(wb->buf, data, crt_size);
+		memcpy(wb->buf+q->last_used, data, crt_size);
 		q->last_used+=crt_size;
 		size-=crt_size;
 		data+=crt_size;