Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for FTP crashes in some libcurl versions #755

Closed
wants to merge 1 commit into from
Closed

Conversation

jeroen
Copy link
Member

@jeroen jeroen commented Oct 11, 2024

There is a bug in libcurl 8.5.0 - 8.7.1 that causes a crash if you mix http and ftp requests in the same handle. Unfortunately these versions of libcurl are common on both Linux and MacOS.

A reprex that crashes both on Ubuntu 24.04 and all current MacOS versions:

library(httr)
url1 <- "https://en.wikipedia.org/wiki/Bioconductor"
response1 <- GET(url1)
url2 <- "ftp://ftp.ensembl.org/pub/release-71/gtf/caenorhabditis_elegans/Caenorhabditis_elegans.WBcel235.71.gtf.gz"
response2a <- GET(url2, write_disk(tempfile()))
response2b <- GET(url2, write_disk(tempfile()))

Pooling handles is a legacy feature that is not recommended anymore. The only use is sharing cookies between requests. However FTP requests don't have cookies, so it makes no sense to pool the handle. A straightforward fix therefore is to only pool handles for http requests.

Even though httr is not intended for FTP and not actively maintained, I still think we should push this fix.

@jeroen jeroen marked this pull request as draft October 11, 2024 13:24
@jeroen
Copy link
Member Author

jeroen commented Oct 11, 2024

Actually I should better try to work around it in curl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant