cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTPS POST closing connection

From: Rogerio Saran <rsaran_at_organox.com.br>
Date: Wed, 27 Mar 2002 11:18:08 -0300

I looked for something similar to this in the mailing lists, without
sucess. Maybe I am just doing something badly wrong...

I am writing a wrapper around libcurl (7.9.5) to make it suitable to be
called through libwww-perl (LWP). The goal is to replace the current LPW
https handler with a higher performance one.

I was succesful with simple tests (opening a connection and placing
several GETs). This works fairly well and showed a big performance
improvement.

However, whenever I try a HTTP POST the library closes the connection.
The session log shows it clearly:

>>>> first request, GET

LWP::UserAgent::new: ()
LWP::UserAgent::send_request: GET
https://bankline.itau.com.br/homebanking.htm
Organox::Protocol::LibCurl::request: uri
https://bankline.itau.com.br/homebanking.htm
Organox::Protocol::LibCurl::request: prepare 0.002909
* SSL connection using RC4-MD5
* Server certificate:
* subject: /C=BR/ST=Sao Paulo/L=Sao Paulo/O=Banco Itau
S.A./OU=DT-STSI/OU=Terms of use at www.verisign.com/rpa
(c)00/CN=bankline.itau.com.br
* start date: 2001-06-18 00:00:00 GMT
* expire date: 2002-07-15 23:59:59 GMT
* issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign
International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref.
LIABILITY LTD.(c)97 VeriSign
* Connected to bankline.itau.com.br (200.246.143.202)
> GET /homebanking.htm HTTP/1.1^M
Host: bankline.itau.com.br^M
Pragma: no-cache^M
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*^M
User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)^M
^M

>>>>> here libcurl keeped the connection

* Connection #0 left intact
Organox::Protocol::LibCurl::request: Curl::easy::perform result 0

>>>>> response header dump

Organox::Protocol::LibCurl::build_response: HTTP/1.1 200 OK
Organox::Protocol::LibCurl::build_response: Content-Length: 4844
Organox::Protocol::LibCurl::__ANON__: Date: Wed, 27 Mar 2002 13:58:56 GMT
Organox::Protocol::LibCurl::__ANON__: Accept-Ranges: bytes
Organox::Protocol::LibCurl::__ANON__: ETag: "0625e6a8ea2c01:1101"
Organox::Protocol::LibCurl::__ANON__: Server: Microsoft-IIS/4.0
Organox::Protocol::LibCurl::__ANON__: Content-Length: 4844
Organox::Protocol::LibCurl::__ANON__: Content-Type: text/html
Organox::Protocol::LibCurl::__ANON__: Last-Modified: Thu, 01 Mar 2001
20:30:12 GMT
Organox::Protocol::LibCurl::request: final 0.002278
LWP::Protocol::collect: read 4844 bytes

>>>>> 2nd request, POST

LWP::UserAgent::send_request: POST
https://bankline.itau.com.br/GRIPNET/gracgi.EXE
Organox::Protocol::LibCurl::request: POSTFIELDS ...ommited...
Organox::Protocol::LibCurl::request: uri
https://bankline.itau.com.br/GRIPNET/gracgi.EXE

>>>>> ok, that is what we want

* Re-using existing connection! (#0)
* Connected to bankline.itau.com.br (200.246.143.202)
> POST /GRIPNET/gracgi.EXE HTTP/1.1^M
Host: bankline.itau.com.br^M
Pragma: no-cache^M
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*^M
User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)^M
Content-Length: 91^M
Content-Type: application/x-www-form-urlencoded^M
^M
...post data...

>>>>> oh no!

* Closing connection #0
Organox::Protocol::LibCurl::request: Curl::easy::perform result 0
Organox::Protocol::LibCurl::request: request 8.773619
Organox::Protocol::LibCurl::request: read 26547 bytes

>>>>> the response code is "100 continue"...

Organox::Protocol::LibCurl::build_response: HTTP/1.1 100 Continue
Organox::Protocol::LibCurl::build_response: Date: Wed, 27 Mar 2002
13:58:56 GMT
Organox::Protocol::LibCurl::__ANON__: Date: Wed, 27 Mar 2002 13:58:56 GMT
Organox::Protocol::LibCurl::__ANON__: Server: Microsoft-IIS/4.0
Organox::Protocol::LibCurl::request: final 0.002665
LWP::Protocol::collect: read 26458 bytes

Anybody wonder why libcurl is closing the connection even after
receiving a "continue" response code?

*Saran
Received on 2002-03-27