Merge pull request #30 from ucloud/bugfix_remove_useless_timer
bugfix remove useless timer
This commit is contained in:
commit
df253cbf26
|
@ -508,25 +508,19 @@ int http_client_common(http_client_t *client, const char *url, int port, const c
|
||||||
}
|
}
|
||||||
|
|
||||||
int http_client_recv_data(http_client_t *client, uint32_t timeout_ms, http_client_data_t *client_data) {
|
int http_client_recv_data(http_client_t *client, uint32_t timeout_ms, http_client_data_t *client_data) {
|
||||||
int rc = SUCCESS_RET;
|
int rc;
|
||||||
Timer timer;
|
|
||||||
|
|
||||||
init_timer(&timer);
|
|
||||||
countdown_ms(&timer, timeout_ms);
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if ((NULL != client_data->response_buf)
|
if ((NULL != client_data->response_buf)
|
||||||
&& (0 != client_data->response_buf_len)) {
|
&& (0 != client_data->response_buf_len)) {
|
||||||
rc = _http_client_recv_response(client, timeout_ms, client_data);
|
rc = _http_client_recv_response(client, timeout_ms, client_data);
|
||||||
}
|
if (rc < 0) {
|
||||||
if(client_data->is_more)
|
LOG_ERROR("_http_client_recv_response is error, rc = %d", rc);
|
||||||
{
|
http_client_close(client);
|
||||||
return SUCCESS_RET;
|
|
||||||
}
|
|
||||||
}while((rc != SUCCESS_RET) && (!has_expired(&timer)));
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return SUCCESS_RET;
|
||||||
|
}
|
||||||
|
|
||||||
void http_client_close(http_client_t *client) {
|
void http_client_close(http_client_t *client) {
|
||||||
if (client->net.handle > 0) {
|
if (client->net.handle > 0) {
|
||||||
|
|
Loading…
Reference in New Issue