Re: [PHP] Is Curl GZIP support broken?

2004-05-05 Thread Stuart
Dac Chartrand wrote:
The following code used to work until i upgraded to 4.3.6
Code:
---
// Get RSS feed
$c =
curl_init('http://www.vegguide.org/rss/feed.rss?all=1omit_hours=1');
curl_setopt($c, CURLOPT_ENCODING, 'gzip');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_jar);
// *** This next line is the problem! ***
$data = curl_exec($c);
curl_close($c);
1) Does it work with the sample URL: 
http://www.vegguide.org/plain/sample.rss ? If yes, then I'm guessing the 
authentication cookie in the cookie_jar has expired.

2) Does it work using the CLI curl?
--
Stuart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Is Curl GZIP support broken?

2004-05-02 Thread Dac Chartrand
The following code used to work until i upgraded to 4.3.6

Code:
---
// Get RSS feed
$c =
curl_init('http://www.vegguide.org/rss/feed.rss?all=1omit_hours=1');
curl_setopt($c, CURLOPT_ENCODING, 'gzip');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_jar);
// *** This next line is the problem! ***
$data = curl_exec($c);
curl_close($c);
Expected result:

$data should be text. xml_parse($xml, $data) should be able to handle it.
Actual result:
--
$data is compressed gzip binaray data. I can't use it in this format.
What changed?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Is Curl GZIP support broken?

2004-05-02 Thread Curt Zirzow
* Thus wrote Dac Chartrand ([EMAIL PROTECTED]):
 The following code used to work until i upgraded to 4.3.6
 
 Code:
 ---
 // Get RSS feed
 $c =
 curl_init('http://www.vegguide.org/rss/feed.rss?all=1omit_hours=1');
 curl_setopt($c, CURLOPT_ENCODING, 'gzip');
 curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_jar);
 // *** This next line is the problem! ***
 $data = curl_exec($c);
 curl_close($c);

Check curl_errno() and curl_error().

it sounds like there is a problem with your libcurl


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is Curl GZIP support broken?

2004-05-02 Thread Dac Chartrand
Check curl_errno() and curl_error().

it sounds like there is a problem with your libcurl

I'm not getting any errors using the above functions.

Sample PHP code is available at:

http://www.vegguide.org/plain/rss-code/get_and_parse_vegguide_rss_feed-php

(Requires an account to be able to download RSS data) It used to work, 
now it doesn't. The problem is the follwing line:

$data = curl_exec($c);

$data used to be a string. Now it's GZIP compressed binary data that i 
can't work with.

The only thing that has changed is me upgrading to PHP 4.3.6

Any other ideas?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Is Curl GZIP support broken?

2004-05-02 Thread Dac Chartrand
PS: I'm using w2k with apache.

http://www.php.net/get/php-4.3.6-Win32.zip/from/a/mirror

Check curl_errno() and curl_error().

it sounds like there is a problem with your libcurl

Curt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Is Curl GZIP support broken?

2004-05-02 Thread Curt Zirzow
* Thus wrote Dac Chartrand ([EMAIL PROTECTED]):
 Check curl_errno() and curl_error().
 
 it sounds like there is a problem with your libcurl
 
 
 I'm not getting any errors using the above functions.
 
 Sample PHP code is available at:
 
 http://www.vegguide.org/plain/rss-code/get_and_parse_vegguide_rss_feed-php
 
 (Requires an account to be able to download RSS data) It used to work, 
 now it doesn't. The problem is the follwing line:
 
 $data = curl_exec($c);
 
 $data used to be a string. Now it's GZIP compressed binary data that i 
 can't work with.

php simply calls the libcurl function and returns what libcurl came
back with.  There might be problem with the curl.dll your using.

You might want to try setting CURLOPT_ENCODING to 'defalate'.
otherwise dont set any compression requests.

I've tested  your code with php5 and libcurl 7.10 and gzip
compression works fine.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is Curl GZIP support broken?

2004-05-02 Thread Dac Chartrand
php simply calls the libcurl function and returns what libcurl came
back with.  There might be problem with the curl.dll your using.
The curl.dll i am using is packaged with the binary distribution of PHP 
(i'm on windows), so if there is a problem with it, there's a problem 
with the PHP distro.

I filed a bug indicating this, but was marked as bogus.

http://bugs.php.net/bug.php?id=28168

You might want to try setting CURLOPT_ENCODING to 'defalate'.
otherwise dont set any compression requests.
This seems to work (slowly?) under test conditions. I'll keep you posted 
if it works when the 'cron' job is executed several hours from now.

Thank you for your help.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php