cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl vs libcurl

From: Thomas A. Moulton <tom_at_moulton.us>
Date: Sun, 30 Jul 2006 13:37:39 -0400

I have a C program using libcurl and when I attempt to access one page that needs cookies, etc I get an empty page (0 bytes returned)

Yet when I use the same cookie-jar using curl from the command line I get the page just fine.

If I enable CURLOPT_VERBOSE the headers and actions are the same.

I use this same c function to access other pages just fine

What could possibly be different?

Tom
============================
curl Verbose headers

$ curl -v --cookie bg.txt http://profiles.games.yahoo.com/games/profile2?name=xxxxxx\&intl=us\&consolidater=backgammon.yahoo >/dev/null
* About to connect() to profiles.games.yahoo.com port 80
* Trying 66.218.71.3... connected
* Connected to profiles.games.yahoo.com (66.218.71.3) port 80
> GET /games/profile2?name=xxxxxx&intl=us&consolidater=backgammon.yahoo HTTP/1.1
> User-Agent: curl/7.15.1 (i386-portbld-freebsd6.0) libcurl/7.15.1 OpenSSL/0.9.7e zlib/1.2.2
> Host: profiles.games.yahoo.com
> Accept: */*
> Cookie: T=z=I0NzEBI6izEBWIjGXpG9sus&a=YAE&sk=DAALQEZ8O9v5Ta&d=YQFZQUUBb2sBWlcwLQF0aXABRzUzWXRDAXp6AUkwTnpFQmdXQQ--; PH=fn=7jJTfAZ_t2sWCbh2; Y=v=1&n=2g3uchp1rid10&l=j0cmehaxux/o&p=m1r11qv003000000&r=fg&lg=us&intl=us; F=a=sbCaTzAsvXAsStocOZZbcxaS0Wr4HkIG6cEjom1IrSKLHBBgTJvRM8rZdrGr&b=isZL
>
< HTTP/1.1 200 OK
< Date: Sun, 30 Jul 2006 16:24:30 GMT
< P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 25762 0 25762 0 0 37632 0 --:--:-- --:--:-- --:--:-- 69711* Closing connection #0

libcurl verbose headers

url http://profiles.games.yahoo.com/games/profile2?name=xxxxxx&intl=us&consolidater=backgammon.yahoo
* About to connect() to profiles.games.yahoo.com port 80
* Trying 66.218.71.3... * connected
* Connected to profiles.games.yahoo.com (66.218.71.3) port 80
> GET /games/profile2?name=xxxxxx&intl=us&consolidater=backgammon.yahoo HTTP/1.1
User-Agent: curl/7.15.1 (i386-portbld-freebsd6.0) libcurl/7.15.1 OpenSSL/0.9.7e zlib/1.2.2
Host: profiles.games.yahoo.com
Accept: */*
Cookie: T=z=I0NzEBI6izEBWIjGXpG9sus&a=YAE&sk=DAALQEZ8O9v5Ta&d=YQFZQUUBb2sBWlcwLQF0aXABRzUzWXRDAXp6AUkwTnpFQmdXQQ--; PH=fn=7jJTfAZ_t2sWCbh2; Y=v=1&n=2g3uchp1rid10&l=j0cmehaxux/o&p=m1r11qv003000000&r=fg&lg=us&intl=us; F=a=sbCaTzAsvXAsStocOZZbcxaS0Wr4HkIG6cEjom1IrSKLHBBgTJvRM8rZdrGr&b=isZL

< HTTP/1.1 200 OK
< Date: Sun, 30 Jul 2006 16:24:00 GMT
< P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html
* Closing connection #0
got 0 bytes
Done
Received on 2006-07-30