diff --git a/http/client/HttpClient.cpp b/http/client/HttpClient.cpp index f3ae2de12..0960b682b 100644 --- a/http/client/HttpClient.cpp +++ b/http/client/HttpClient.cpp @@ -345,7 +345,9 @@ static int http_client_exec(http_client_t* cli, HttpRequest* req, HttpResponse* if (left_time != INFINITE) { so_sndtimeo(cli->fd, left_time); } + if (req->cancel) goto disconnect; nsend = http_client_send_data(cli, data + total_nsend, len - total_nsend); + if (req->cancel) goto disconnect; if (nsend <= 0) { CHECK_TIMEOUT err = socket_errno(); @@ -368,7 +370,9 @@ static int http_client_exec(http_client_t* cli, HttpRequest* req, HttpResponse* if (left_time != INFINITE) { so_rcvtimeo(cli->fd, left_time); } + if (req->cancel) goto disconnect; nrecv = http_client_recv_data(cli, recvbuf, sizeof(recvbuf)); + if (req->cancel) goto disconnect; if (nrecv <= 0) { CHECK_TIMEOUT err = socket_errno();