Closed (fixed)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 May 2011 at 06:57 UTC
Updated:
24 Aug 2013 at 18:37 UTC
Jump to comment: Most recent file
Comments
Comment #1
Slim Pickens commentedI found a work-around by disabling cURL in /sites/all/modules/feeds/libraries/http_request.inc.
On line 220 I changed
to
Whether this is optimal or will other consequences I don't know but at least my site is pulling feed items.
Comment #2
tomcatuk commentedThanks, this snippet of information is what I've been after for ages. Wondering if next time the module get's an update this setting gets overridden though.
Comment #3
Slim Pickens commentedYes, you'll need to manually edit this function after every update!
It would be nice if this was configurable through the Feeds UI.
Comment #4
archnode commentedThis is actually an option you can use in your settings.php
Just put in:
$conf['feeds_never_use_curl'] = true;You can read about it in README.txt.
It would be great if Feeds could recognize and use proxy settings as discussed in http://drupal.org/node/7881, or disable internal cURL-functionality accordingly.
Comment #5
vladimirausI did some work behind the proxy.
Looks like there are some problems with cURL when behind the proxy.
There is a line of code added to HTTP header which is not catered by CURLINFO_HEADER_SIZE variable used in feeds.
The current patch is harmless and will work once the following patch it applied to core:
http://drupal.org/files/drupal-7881-429-add-proxy-support-for-http-reque...
From comments it seems like it's gonna happen in 7.16
Current patch adds proxy URL and port support to feeds (which you need to setup in settings.php file after above patch is applied).
Username and password support is not too far away.
Comment #6
twistor commentedNeed space above the comment. White space issues.
Spaces inbetween .
Variable name should not use camel case.
What is this last part doing? Can you link to the bug report?
Comment #7
vladimirausYeah, seems like some space issue. Will resubmit tomorrow.
The last part is actually taking care of extra message that is present in HTTP header only when dealing with proxy.
Here's few examples I found of the same problem.
- http://core.trac.wordpress.org/ticket/17731
- https://github.com/skyzyx/requestcore/issues/1
Comment #8
vladimirausSyntax updated for patch #5
Comment #9
Jaza commentedPatch from #8 works for me - was getting cURL errors due to proxy before applying; able to import feed items with no errors after applying.
Now that proxy support is in latest D7 core, Feeds should really support this too. Let's get this in.
Comment #10
jyraya commentedI am reviewing this patch regarding with the proxy settings defined for D7.
I see that the patch "uses" the function parameters that are used for the HTTP authentication attached to the URL (I understood well the function doc.) for the proxy authentication
does it not used the proxy settings of D7 (set in settings.php) instead?
Concerning the proxy authentication method, the patch uses "NTLM" one without the possibility to configure it. Could we not to have it configurable?
So we could have something like that:
For the location of the configuration parameter "proxy_auth_method", it could be discussed with people in charge of the issue #7881: Add support to drupal_http_request() for proxy servers (http not https).
What do you think?
Comment #11
twistor commentedThis patch needs to be re-rolled. Some different header manipulation for cURL was added.
#10, Correct. This patch should use the username:password found in settings.php, not the ones in the URL. The proxy config should be transparent to the request, not bound to end-user config.
As for the auth method, we should just be able to use CURLAUTH_ANY and be done with it.
We can't bring up the auth method in core because that's a cURL specific setting not found in drupal_http_request().
Comment #12
bigjim commentedre-roll of patch including #10.
According to php docs we can't use CURLAUTH_ANY
"The HTTP authentication method(s) to use for the proxy connection. Use the same bitmasks as described in CURLOPT_HTTPAUTH. For proxy authentication, only CURLAUTH_BASIC and CURLAUTH_NTLM are currently supported. " (from http://php.net/manual/en/function.curl-setopt.php)
Comment #13
bigjim commentedmarking needs review
Comment #14
jameria21 commentedI've downloaded, applied and tested this patch. It is very straight forward and does exactly what I've been needing!
Comment #15
twistor commentedI've combined #6 and #12 to come up with a workable solution.
http://drupalcode.org/project/feeds.git/commit/ddee3f9
Comment #17
cgrijs commentedThe following workaround in lines 216-221:
216 if ($proxy_server && _drupal_http_use_proxy($uri['host'])) {
217 $http_header_break = "\r\n\r\n";
218 $response = explode($http_header_break, $data);
219 if (count($response) > 2) {
220 $data = substr($data, strlen($response[0] . $http_header_break), strlen($data));
221 }
222 }
Actually breaks the module in the more recent versions of libcurl, where this bug is fixed (http://sourceforge.net/p/curl/bugs/1204/)
Comment #18
twistor commentedCan you open a new issue?
Also, do you know what version of curl/libcurl contains this fix?
Thanks.
Comment #19
sajt commentedFor me too. You need to comment line 220 because I think somwhere this bug is patched.