less than
This commit is contained in:
parent
9630481259
commit
9fcf1ddb0d
1 changed files with 2 additions and 1 deletions
|
@ -106,10 +106,11 @@ void retry_write_host(uint8_t* recv, int recvCount) {
|
||||||
void retry_read_host(void* buf, unsigned int count) {
|
void retry_read_host(void* buf, unsigned int count) {
|
||||||
if(connectionFd == -1) {
|
if(connectionFd == -1) {
|
||||||
connectionFd = accept(listenFd, NULL, NULL);
|
connectionFd = accept(listenFd, NULL, NULL);
|
||||||
|
log(LEVEL_DEBUG, "Accepted connection\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int c = 0;
|
int c = 0;
|
||||||
while(c <= count) {
|
while(c < count) {
|
||||||
int s = read(connectionFd, buf, count - c);
|
int s = read(connectionFd, buf, count - c);
|
||||||
if(s <= 0) {
|
if(s <= 0) {
|
||||||
close(connectionFd);
|
close(connectionFd);
|
||||||
|
|
Loading…
Add table
Reference in a new issue