Skip to content

Commit

Permalink
Allow open(curl(url) to be interrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 21, 2024
1 parent d4bcb40 commit d1a8441
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d1a8441

Please sign in to comment.