1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00

fix bug on partial response (extended)

This commit is contained in:
stefanocasazza 2015-02-05 20:04:40 +01:00
parent 840efebf14
commit 02cd2ad53c
5 changed files with 15 additions and 4 deletions

View File

@ -1392,6 +1392,8 @@ bool UClientImage_Base::writeResponse()
U_RETURN(true);
}
int idx = 0, iovcnt = 4;
loop:
if (iBytesWrite > 0)
{
@ -1413,7 +1415,16 @@ loop:
{
if (UNotifier::waitForWrite(socket->iSockDesc, U_TIMEOUT_MS) != 1) U_RETURN(false);
iBytesWrite = USocketExt::writev(socket, iov_vec, 4, ncount, UServer_Base::timeoutMS);
while (iov_vec[idx].iov_len == 0)
{
++idx;
--iovcnt;
U_INTERNAL_ASSERT_MINOR(idx, 4)
U_INTERNAL_ASSERT_MAJOR(iovcnt, 0)
}
iBytesWrite = USocketExt::writev(socket, iov_vec+idx, iovcnt, ncount, UServer_Base::timeoutMS);
if (LIKELY(iBytesWrite == (int)ncount))
{

View File

@ -651,6 +651,7 @@ int UNoCatPlugIn::handlerTime()
UTimeVal::setSecond(next_event_time);
}
// ---------------
// return value:
// ---------------
// -1 - normal

View File

@ -439,8 +439,6 @@ error: U_INTERNAL_DUMP("errno = %d", errno)
iov[idx].iov_len = 0;
++idx;
U_INTERNAL_ASSERT_MINOR(idx, iovcnt)
}
U_INTERNAL_DUMP("iov[%d].iov_len = %d", idx, iov[idx].iov_len)
@ -453,6 +451,8 @@ error: U_INTERNAL_DUMP("errno = %d", errno)
iov += idx;
iovcnt -= idx;
U_INTERNAL_ASSERT_MAJOR(iovcnt, 0)
timeoutMS = 0;
goto write;

View File

@ -1 +0,0 @@
B0D1

Binary file not shown.