From 840efebf14e1170aaf44fe6adbeef0561e06d24d Mon Sep 17 00:00:00 2001 From: stefanocasazza Date: Thu, 5 Feb 2015 16:43:56 +0100 Subject: [PATCH] fix bug on partial response --- src/ulib/utility/socket_ext.cpp | 5 +++-- tests/examples/TSA/CA/tsaserial | 2 +- tests/ulib/inp/test.db | Bin 4096 -> 4096 bytes 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ulib/utility/socket_ext.cpp b/src/ulib/utility/socket_ext.cpp index a74744d2..cdc6f429 100644 --- a/src/ulib/utility/socket_ext.cpp +++ b/src/ulib/utility/socket_ext.cpp @@ -429,8 +429,10 @@ error: U_INTERNAL_DUMP("errno = %d", errno) U_INTERNAL_ASSERT_MAJOR(byte_written, 0) - if (byte_written < (int)count) + if ((uint32_t)value < count) { + count -= value; + while ((size_t)value >= iov[idx].iov_len) { value -= iov[idx].iov_len; @@ -451,7 +453,6 @@ error: U_INTERNAL_DUMP("errno = %d", errno) iov += idx; iovcnt -= idx; - count -= value; timeoutMS = 0; goto write; diff --git a/tests/examples/TSA/CA/tsaserial b/tests/examples/TSA/CA/tsaserial index 5bba5f60..0baf9488 100644 --- a/tests/examples/TSA/CA/tsaserial +++ b/tests/examples/TSA/CA/tsaserial @@ -1 +1 @@ -B0BC +B0D1 diff --git a/tests/ulib/inp/test.db b/tests/ulib/inp/test.db index 6de4c5ce8a09dc4fbef814c3831d41f004405425..9bf470eb621a7222427d1a8b2c236512f3750426 100644 GIT binary patch delta 76 zcmZorXi%6SE%=9lfq?~xp}?nTqK+}+pN$DO7?}*&C)Y98u~(ERXl9-<*u0;~o{`aT a^MB@7%v`1lhNf1A23Dp9n?JMjasU9+aui4a delta 76 zcmZorXi%6SE%=aufq?~xp};3?qK+}+!;J|y7@4%$C)Y98u~(ERXl9<#+Pt61o{>>| a^MB@7%v>f4hGtfVhE^sfn?JMjasU9rh!gk#