cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: libcurl problem

From: Kamieniecki, Darcy <Darcy.Kamieniecki_at_ta-alberta.ca>
Date: Thu, 30 Jan 2003 09:58:49 -0700

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: January 30, 2003 8:51 AM
To: libcurl Mailing list
Subject: RE: libcurl problem

On Thu, 30 Jan 2003, Kamieniecki, Darcy wrote:

> > I advice you to upgrade libcurl to a more recent version.

> If I can avoid it, I would like to postpone that until my next release of
> my application.

Right, but you could do a separate temporary install somewhere just to see
if
it alters the behavior you're seeing. It is always kinda silly to chase for
bugs that already has been fixed in a more recent version.
        Agreed, I will attempt this on the weekend.

> > curl -s --cert pemfile.pem https://www.xxx.yyy.zzz/login.asp -d
> user=<user>
> > -d pswd=<password> -d login=Submit https://www.xxx.yyy.zzz/CheckUser.asp
> > https://www.xxx.yyy.zzz/info.csv
>
> So why is your java code not doing it this way? You say it fails to pass
on
> cookies, but this command line version doesn't use cookies at all!?

> How do I get my java code to do it that same way as the above
> command line?
> How do I tell it to the session id cookie?

In this command line, it doesn't use the session id cookie. curl ignores
cookies by default. You have to explicitly switch it on.
        I did not know this. As a test, I commented out the COOKIE lines in
my java code.
        I have a sample of the output at the end of this email.

> > The "session id" being a cookie, can you see that it is stored in the
> > cookie file properly after the whole operation?

> The cookie file is never generated. I looked through the mailing list and
> you mention that curl_easy_cleanup() should be called to create the file.

Correct.

> Which object has this method?

Uh, I guess in the java interface that function isn't called until the
object
is killed by the garbage collector or something.
        My java code loops once every minute for an indefinite period of
time.
        I do not want to have to delete the object and then reinstantiate
that frequent.

> > Can you see it being sent and received by curl in the first response?

> Yes, I can.

And in the second request, are you saying that the cookie is not passed to
the server correctly anyway?

If so, can you show us how the headers look like that you receive in the
first response?
SEE BELOW

NOTE: I also commented out the FOLLOWLOCATION because it went to the wrong
page.
        Thanks again for any help :-)

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
============================================================================
==========
setopt int + object, option = 20011 cls= 0x809fcbc
setopt write callback and write file pointer 0x81b2980, java = 0x81aabf4
setopt int + string
setopt int + int
setopt int + int
setopt int + int
setopt int + string
setopt int + string
* SSL connection using RC4-MD5
* Server certificate:
*        subject: 111111111111
*        start date: 22222222222
*        expire date: 333333333333
*        issuer: 444444444444444
* Connected to www.xxx.yyy.zzz (www.xxx.yyy.zzz) port 443
> POST /login.asp HTTP/1.1
Host: www.xxx.yyy.zzz
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 58
Content-Type: application/x-www-form-urlencoded
name=<USERNAME>&pswd=<PASSWORD>&login=Submit2467 bytes data received in
callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_5224ee		// MY DEBUG
java-method returned 0
100 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_f6a746		// MY DEBUG
java-method returned 0
* Connection #0 left intact
setopt int + string
* Re-using existing connection! (#0)
* Connected to www.xxx.yyy.zzz (www.xxx.yyy.zzz) port 443
> POST /CheckUser.asp HTTP/1.1
Host: www.xxx.yyy.zzz
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 58
Content-Type: application/x-www-form-urlencoded
name=<USERNAME>&pswd=<PASSWORD>&login=Submit34 bytes data received in
callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_15ff48b		// MY DEBUG
java-method returned 0
98 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_affc70		// MY DEBUG
java-method returned 0
* Connection #0 left intact
setopt int + string
* Re-using existing connection! (#0)
* Connected to www.xxx.yyy.zzz (www.xxx.yyy.zzz) port 443
> POST /info.csv HTTP/1.1
Host: www.xxx.yyy.zzz
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 58
Content-Type: application/x-www-form-urlencoded
name=<USERNAME>&pswd=<PASSWORD>&login=Submit1 bytes data received in
callback:  	// the request stalls
	
// at this point for ~60
// seconds
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_1e63e3d		// THIS SHOULD BE NUMERIC FIELDS
java-method returned 0
33 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_1004901		// THIS SHOULD BE NUMERIC FIELDS
java-method returned 0
8 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_1b90b39		// THIS SHOULD BE NUMERIC FIELDS
java-method returned 0
8 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_18fe7c3
java-method returned 0
31 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_b8df17
java-method returned 0
16 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_13e8d89
java-method returned 0
7 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_1be2d65
java-method returned 0
31 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_9664a1
java-method returned 0
13 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_1a8c4e7
java-method returned 0
7 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_1172e08
java-method returned 0
31 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_cf2c80
java-method returned 0
114 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_1729854
java-method returned 0
98 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_6eb38a
java-method returned 0
8 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_1cd2e5f
java-method returned 0
1 bytes data received in callback:
ptr=0x81b2980, java=0x81aabf4 cls=0x809fcbc
created byte-array
Value is [B_at_19f953d
java-method returned 0
* Connection #0 left intact
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-01-30