[wp-hackers] WP_HTTP deflating small packets
Tim Nash
tim at newmedias.co.uk
Tue Mar 1 21:00:21 UTC 2011
CURL is working fine, and can we skip the suggest to upload phpinfo
functions please :) The hint to CURL working fine being strings over 7
chars long were coming back fine.
The issue is not with CURL (doing a simple curl request also brings
the content back even if below 7 characters) the issue is with wp_http
object automatically inserting extra parameters in the header,
presumably to aid pushing and pulling large amount of content.
Cheers
Tim
On 1 March 2011 19:27, aditya sharma <sharmaaditya333 at gmail.com> wrote:
> Can you create a phpinfo page and link that to this post so we can see
> what's currently configured? Just create a page called phpinfo.php which
> contains the following line:
>
> <?php phpinfo() ?>
>
> And upload it to your site via FTP. This will tell us a little about how
> your server is configured and whether or not cURL is enabled.
>
> Warm Regards
> Aditya Sharma
>
>
>
>
> On Tue, Mar 1, 2011 at 7:45 PM, Tim Nash <tim at newmedias.co.uk> wrote:
>
>> Hi all,
>> We have been having interesting problem with wp_http simple request
>> returns either a 1 or an error string.
>> Problem is instead of return a 1 it appears to be returning a binary
>> string. If we put more then 7 chars on the page then they are returned
>> happily.
>>
>> $request = new WP_Http;
>> $result = $request->request($url);
>> if (is_wp_error($result)) {
>> return FALSE;
>> }
>> if ($result['response']['code'] == 200) {
>> // success
>> return $result['body'];
>> } else {
>> return FALSE;
>> }
>> What's being returned
>> Array ( [method] => GET [timeout] => 5 [redirection] => 5
>> [httpversion] => 1.0 [user-agent] => WordPress/3.1;
>> http://wordpress_dev [blocking] => 1 [headers] => Array (
>> [Accept-Encoding] => deflate;q=1.0, compress;q=0.5 ) [cookies] =>
>> Array ( ) [body] => [compress] => [decompress] => 1 [sslverify] => 1
>> [ssl] => [local] => )
>>
>> The weird bit is:
>> Array ( [0] => Accept-Encoding: deflate;q=1.0, compress;q=0.5 )
>>
>> Looking at wp_http this seems to being set and can't be overridden. We
>> have got round the problem as we are simply changing the return to
>> pass enough data but thats a hack rather then a solution, wondering if
>> anyone had come across this problem (that piece of code has been our
>> work horse for some time so its only a recent thing) and if anyone has
>> a solution.
>>
>> Cheers
>> Tim
>>
>> --
>> Tim Nash
>> Technical Director
>>
>> Coding Futures Ltd
>> The Tannery
>> 91 Kirkstall Road
>> Leeds
>> LS3 1HS
>>
>> Company House Registration Number: 07350515
>> Company Registered in England and Wales
>>
>> Contact Telephone: +44(0)113 2473850
>>
>> The contents of this email is for the named parties, if you have
>> receieved this email in error please accept our apologises. Unless
>> separately mentioned the content of the email are considered private with
>> content belonging to the authors.
>>
>> NewMedias is a brand for Coding Futures Ltd
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
Tim Nash
Technical Director
Coding Futures Ltd
The Tannery
91 Kirkstall Road
Leeds
LS3 1HS
Company House Registration Number: 07350515
Company Registered in England and Wales
Contact Telephone: +44(0)113 2473850
The contents of this email is for the named parties, if you have
receieved this email in error please accept our apologises. Unless
separately mentioned the content of the email are considered private with
content belonging to the authors.
NewMedias is a brand for Coding Futures Ltd
More information about the wp-hackers
mailing list