diff --git a/src/curl.c b/src/curl.c index 540c6f2..7f0f73f 100644 --- a/src/curl.c +++ b/src/curl.c @@ -224,6 +224,10 @@ static Rboolean rcurl_open(Rconnection con) { while(block_open && req->has_more && !req->has_data) { int numfds; massert(curl_multi_wait(req->manager, NULL, 0, 1000, &numfds)); + if(pending_interrupt()) { + reset(con); //cleanup before jumping + assert_message(CURLE_ABORTED_BY_CALLBACK, ""); + } massert(curl_multi_perform(req->manager, &(req->has_more))); for(int msg = 1; msg > 0;){ CURLMsg *out = curl_multi_info_read(req->manager, &msg);