Skip to content

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.

2 participants