[development] PHP 5 > aggregator.module rewrite to XML API?
kb at 2bits.com
Wed Jun 20 00:43:56 UTC 2007
On 6/19/07, Ashraf Amayreh <mistknight at gmail.com> wrote:
> I use CURL rather than the drupal function because drupal uses fsockets,
> fsockets are known to have issues when retrieving from HTTP 1.0 as opposed
> to HTTP 1.1, this is solved by sending specific headers, these headers are
> ignored on some Linux systems and that may increase the response time by as
> much as 5x what CURL would take, normally they would be similar in speed
> although CURL is slightly faster. In specific situations like firewall
> presence or failure in DNS resolution fsockets may stall for a few minutes.
> I read about these issues in a number of articles and I also found them
> listed in the comments under fsocketopen. CURL just saved me the hassle and
> probably tens of issues :-)
> Finally, with CURL I can support both HTTP and FTP URLs weather they are
> authenticated with a username and password or not. Only con to using CURL is
> that it has to be installed on the server machine and enabled in PHP
> (weather as a module or compiled).
>From the comments at the PHP fsockopen page:
EDITORS NOTE: HTTP/1.1 uses persistent connection causing this delay. Use
"Connection: close" header to disable it.
Just a note to everyone who is using fsockopen and fread / fgets for a HTTP
Unless you specify "Connection: Close" in your headers you will need to wait
for the socket to time out before feof($streamPointer) to return true.
This has wasted 2 days of my time, grr!
The first example in the page, before the comments, also does the close for
This is detailed in the RFC too
Are you saying the header Connection: Close is ignored?
Any reason why Drupal should not use HTTP/1.1?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the development