Module: sip-router
Branch: ser_core_cvs
Commit: 74c6d2807c6ecf59f8efad22cfddfd27e4fadfc2
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=74c6d28…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Fri Dec 12 23:02:45 2008 +0000
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
---
tcp_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tcp_main.c b/tcp_main.c
index e26685a..6a6e27a 100644
--- a/tcp_main.c
+++ b/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;