mirror of
https://github.com/lxsang/ant-http
synced 2024-12-25 16:28:21 +01:00
fix looping rw
This commit is contained in:
parent
e98970b378
commit
4e75706e22
BIN
dist/antd-1.0.4b.tar.gz
vendored
BIN
dist/antd-1.0.4b.tar.gz
vendored
Binary file not shown.
@ -301,6 +301,8 @@ int antd_send(void *src, const void* data, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
if(written == 0)
|
||||||
|
written = count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//source->attempt = 0;
|
//source->attempt = 0;
|
||||||
@ -321,6 +323,8 @@ int antd_send(void *src, const void* data, int len)
|
|||||||
}
|
}
|
||||||
else if(count == -1 && errno != EAGAIN && errno != EWOULDBLOCK)
|
else if(count == -1 && errno != EAGAIN && errno != EWOULDBLOCK)
|
||||||
{
|
{
|
||||||
|
if(written == 0)
|
||||||
|
written = count;
|
||||||
//ERROR("Error while writing: %s", strerror(errno));
|
//ERROR("Error while writing: %s", strerror(errno));
|
||||||
break;
|
break;
|
||||||
//return written;
|
//return written;
|
||||||
@ -432,7 +436,8 @@ int antd_recv(void *src, void* data, int len)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(read ==0)
|
||||||
|
read = received;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -475,6 +480,8 @@ int antd_recv(void *src, void* data, int len)
|
|||||||
else if(errno != EAGAIN && errno != EWOULDBLOCK)
|
else if(errno != EAGAIN && errno != EWOULDBLOCK)
|
||||||
{
|
{
|
||||||
ERROR("Error while writing: %s", strerror(errno));
|
ERROR("Error while writing: %s", strerror(errno));
|
||||||
|
if(read ==0)
|
||||||
|
read = received;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user