Closed (fixed)
Project:
HTTP Parallel Request & Threading Library
Version:
7.x-1.11
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Apr 2013 at 19:51 UTC
Updated:
23 May 2013 at 22:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
mikeytown2 commentedI would play around with the various timeouts
(default value) - option_key - short description.
(5) - dns_timeout - maximum number of seconds the DNS portion of a request may take.
(5) - connect_timeout - maximum number of seconds establishing the TCP connection of a request may take.
(20) - ttfb_timeout - maximum number of seconds a connection may take to download the first byte.
Also check
$result->error&$result->codefor any indication of what might be the issue.Also noted is the returned data payload will be stored in PHP's memory. How many megabytes of data are we talking about? You might need to adjust the php memory limit
ini_set('memory_limit','1024M');Also noted is chunk_size_read. Default is 32768 (32K). Increasing this *might* speed up the download as this is the maximum number of bytes fread() will get off of the stream buffer while in the stream_select loop.
Comment #2
matthandThanks for the info. I've increased all of the timeouts, the PHP memory limit and chunk_size_read and still do not see any data. And I really jacked up the limits to ridiculous levels that should cover it.
The code returned is 200 for success.
I am seeing this warning after processing:
Warning: strlen() expects parameter 1 to be string, resource given in httprl_print_empty() (line 2442 of /path/to/sites/all/modules/httprl/httprl.module).
Any further ideas? THANKS!!!!
Comment #3
matthandOddly enough, I switched over to Curl HTTP Request (http://drupal.org/project/chr) and it received the data fine, no errors.
The data string had 6081316 characters. Pretty big!
Comment #4
mikeytown2 commentedFunction in question
http://drupalcode.org/project/httprl.git/blob/e71c38b81c3555b1161097332d...
Things I might need to use in order to fix the warning
http://php.net/types.type-juggling (cast to string)
http://php.net/is-resource
http://php.net/is-string
As for the GET request, can you try drupal_http_request() & file_get_contents() and see if either one of these work?
Comment #5
mikeytown2 commentedThe error that was causing the issue is
iconv(): Detected an illegal character in input string. PHP functions I had to use and redo: mb_convert_encoding(), iconv(), & htmlentities() (If the input string contains an invalid code unit sequence within the given encoding an empty string will be returned, unless either the ENT_IGNORE or ENT_SUBSTITUTE flags are set.).The following patch has been committed.