The workaround specified in
#2427497: Fetching feed via SSL through proxy doesn't work
checks for a certain version of libcurl using curl_version().
My dev (CentOS) and staging (RHEL) environments both report curl version as 7.29.0 but the feed only functions correctly if I disable the workaround.
I think RHEL repositories (and by extension CentOS) - despite receiving updates - do not report the proper version number.
I am currently looking for a way to get PHP to check which repository provided libcurl so that I can exclude the relevant repo. I will post a patch here if I find anything, and would appreciate any guidance if anyone has done this before.
Or perhaps the workaround is flawed.
Comments
Comment #2
darvanenComment #3
darvanenComment #4
MegaChriz CreditAttribution: MegaChriz at WebCoo commentedI'm not an expert on Curl, so I hope you figure out how to fix your issue.
Comment #5
darvanenWell, for the site I'm working on I can just comment out that part of the module (lines 222-228 of feeds/libraries/http_request.inc) and it works fine, I'm just struggling to come up with anything useful for the wider community.
Comment #6
pbattino CreditAttribution: pbattino commentedSame here, on CentOS
My curl is:
If I comment out (293-299 on 7.x-2.0-beta4) everything works.
Comment #7
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThis code was added in #1159806: Add proxy support and slightly modified in #2427497: Fetching feed via SSL through proxy doesn't work.
I don't know how to replicate the issue. Maybe ask VladimirAus for help, as he originally added this piece of code.
Comment #8
pbattino CreditAttribution: pbattino commentedAccording to curl's documentation the code is correct and yet... this workaround breaks the request, for me.
I can't help but think we are reinventing the wheel: I had to fix this problem of wrong header/body split in a custom module developed by a 3rd party, then I saw the same problem solved in chr module (around line 221 in 7.x-1.8 ).
Soooo.... for me the solution is to use set $conf['feeds_never_use_curl'] = TRUE . Since this makes Feed use drupal_http_request and since I use chr as default override for drupal_http_request, problem solved.
However, as an insight for Feeds' own function, probably the best way forward is not to use CURLINFO_HEADER_SIZE to split header and body. Use the same trick used by chr instead, repeated preg_split("/\r\n\r\n|\n\n|\r\r/...)
Comment #9
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@pbattino
What I know is that it is important that the headers are saved separately (for caching). From my understanding, the advantage of using Feeds own HTTP download method are the following:
For the rest, I'm not fully aware of what exactly happens in Feeds' download code.