[SR-Dev] git:ser_core_cvs: tcp: fix for async write

Andrei Pelinescu-Onciul andrei at iptel.org
Tue Dec 16 16:02:51 CET 2008

Module: sip-router
Branch: ser_core_cvs
Commit: 74c6d2807c6ecf59f8efad22cfddfd27e4fadfc2
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=74c6d2807c6ecf59f8efad22cfddfd27e4fadfc2

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at 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,
 		crt_size=MIN_unsigned(last_free, size);
-		memcpy(wb->buf, data, crt_size);
+		memcpy(wb->buf+q->last_used, data, crt_size);

More information about the sr-dev mailing list