Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
$url = 'http://www.gumtree.com.au/s-search-results.html?searchView=LIST&pageNum=1&action=find&urgentOnly=false&sortByName=date&adType=OFFER&adPriceType=&posterType=&topAd=false&gpTopAd=false&highlightOnly=false&minPrice=200&maxPrice=1200&categoryId=18626&keywords=cbr250';
httprl_request($url);
$requests = httprl_send_request();
When I try the above, I get this error: Connection refused by destination. Write.
When I perform it with curl though, all is fine.
Something else that may be relevant or not, when I tried it with drupal_http_request, it returned an error of schema missing, as the 301 redirects to a relative url.
Comment | File | Size | Author |
---|---|---|---|
#9 | httprl-1697244-9-tcp-connects-in-event-loop.patch | 33.67 KB | mikeytown2 |
#8 | httprl-1697244-8-tcp-connects-in-event-loop.patch | 34.55 KB | mikeytown2 |
#7 | httprl-1697244-7-tcp-connects-in-event-loop.patch | 34.47 KB | mikeytown2 |
#3 | httprl-1697244-3-tcp-connects-in-event-loop.patch | 26.97 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedI can't repo this bug. I currently handle relative redirects.
ouputs this
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedChanging title to match the actual reported issue. Redirect with relative URLs do work in httprl.
I actually recently encountered this issue as well. My problem has to do with running a lot of urls (LOTS) through httprl. After about 60 seconds most web servers will drop the connection if nothing was written to it. httprl opens all connections first and then sends data to a select few; once those connections are done it moves on to the next. I need to change this model so httprl opens up the connection when we are ready to do I/O on it. This involves moving stream_socket_client from httprl_request into httprl_send_request inside of the stream_select loop. A decently large refactor in order to fix the issue.
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedThis is the patch that moves the TCP connection inside of the event loop. Big changes in here, will be testing more but it should be backwards compatible for the most part.
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedWith the patch non blocking code is a little slower but it's not a terrible thing. Now takes a little under 1ms per non blocking request. Running 100 non blocking requests takes about 70 ms now.
Comment #5
modstore CreditAttribution: modstore commentedGreat, thanks mate, I will apply the patch to a dev site and see how it goes.
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedStill working on the patch... did find some bugs. Will let you know when it is ready; next patch should be in the next 3 hours or so.
Comment #7
mikeytown2 CreditAttribution: mikeytown2 commentedChanges from previous patch:
- Fixes in the readme files examples.
- Put t() around error text.
- Non blocking mode does not use async connect (hopefully this doesn't cause issues).
- Additional error checking for sync connections in httprl_establish_stream_connection().
- Removal of a lot of the static variables inside of httprl_send_request().
- Merge "See if end server has dropped the connection" and timeouts code as they both look the same to PHP.
- Changes to httprl_background_processing().
Comment #8
mikeytown2 CreditAttribution: mikeytown2 commentedFixed 3 php notices in this patch. Everything looks good from what I can see on my end.
Comment #9
mikeytown2 CreditAttribution: mikeytown2 commentedDecided to revert "Non blocking mode does not use async connect". One can do this if they want to make sure the non blocking request was seen by the server.
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commented#9 has been committed to 6.x & 7.x