Fix bug when read returns -1

When the socket down the "read" function returns -1.
Then the while(read_byte > 0) only works for signed types.
This commit is contained in:
Júnio Teixeira 2019-06-12 13:23:21 -03:00 committed by GitHub
parent 8f378b41c8
commit 87df81ebb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,8 @@ static inline void parse_http_header(char *header)
HTTP_Client_State HttpClient_dowload(Http_client_info *info)
{
struct addrinfo *res;
unsigned int tot_http_pdu_rd, read_byte, full;
unsigned int tot_http_pdu_rd, full;
ssize_t read_byte;
int err, sock;
char *wrt_ptr;
@ -207,6 +208,8 @@ HTTP_Client_State HttpClient_dowload(Http_client_info *info)
full = 0;
vTaskDelayMs(50);
}
//printf("Download size read data : %d\n", read_byte);
} while (read_byte > 0);
info->final_cb(info->buffer, full);