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:
parent
8f378b41c8
commit
87df81ebb7
1 changed files with 4 additions and 1 deletions
|
@ -110,7 +110,8 @@ static inline void parse_http_header(char *header)
|
||||||
HTTP_Client_State HttpClient_dowload(Http_client_info *info)
|
HTTP_Client_State HttpClient_dowload(Http_client_info *info)
|
||||||
{
|
{
|
||||||
struct addrinfo *res;
|
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;
|
int err, sock;
|
||||||
char *wrt_ptr;
|
char *wrt_ptr;
|
||||||
|
|
||||||
|
@ -207,6 +208,8 @@ HTTP_Client_State HttpClient_dowload(Http_client_info *info)
|
||||||
full = 0;
|
full = 0;
|
||||||
vTaskDelayMs(50);
|
vTaskDelayMs(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//printf("Download size read data : %d\n", read_byte);
|
||||||
} while (read_byte > 0);
|
} while (read_byte > 0);
|
||||||
|
|
||||||
info->final_cb(info->buffer, full);
|
info->final_cb(info->buffer, full);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue