---------- Forwarded message ----------
From: Prabu RM <[email protected]>
Date: Mon, Feb 13, 2012 at 1:49 PM
Subject: Multiple requests on Same CURL handle fails.
To: [email protected]


Hi,

We used to transfer files to remote server using libcurl. All we know there
are methods like *PUT,POST,GET,HEAD,DELETE* in order to manipulate the
transfer file. Here is one major issue we are facing on libcurl.

*Issue:* Multiple request methods say HEAD & PUT in a single CURL reusing
handle fails and throws errors like below.

$$$$$$$$$$$$$$$$$$$$* SSL read:
error:00000000:lib(0):func(0):reason(0), errno 10054
* Connection died, retrying a fresh connect
* Issue another request to this URL:
'https://s3-rrs-monish.s3.amazonaws.com/wintest4%2F1%2Fwintest4client%2Ftest17%2F03%5F02%5F2012%5F1134%2F1%2D500%
Data results:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>RequestTimeout</Code><Message>Your socket connection to
the server was not read from or written to within the timeout period.
Idle connec
tions will be 
closed.</Message><RequestId>41ECE453069ED950</RequestId><HostId>MCaoqw4KFlotvIlcldcUKkDJZAr+4MAqfibasmCTDVjZBFcyIOg9RJmCRIp6IVCB</HostId
></Error>
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>RequestTimeout</Code><Message>Your socket connection to
the server was not read from or written to within the timeout period.
Idle connec
tions will be 
closed.</Message><RequestId>41ECE453069ED950</RequestId><HostId>MCaoqw4KFlotvIlcldcUKkDJZAr+4MAqfibasmCTDVjZBFcyIOg9RJmCRIp6IVCB</HostId
></Error>
*To Reproduce simply:*

*int k = 0;
CURL* curlPtr = curl_easy_init();
while(K<1000)
{
     Perform_Curl_Operation(curlPtr,FileName1,"HEAD");
     Perform_Curl_Operation(curlPtr,FileName2,"PUT");

     k++;
}
*
Attached herewith is the sample output file which contains the curl
verbose output.

We also for every call the curl_slist_free_all(headers); happens
without fail. Hence we believe there could be some memory CACHE which
has been duplicated on next request.

We could see when we use same CURL handle the Content-Length request
header added in HEAD request header followed by PUT request. See in
attached file. What brings requests headers mess up when using same
CURL handle.

We believe Reinitializing CURL handle at every request is not fair but
fixes this issue.
*
Our current fix:* If the request METHOD arrives is different from
previous request METHOD then the CURL handle will be Reinitialized.
This fix has been put application level and we would like expect this
from you if you have any other fix on this.

*Curl Version:*

Linux: curl-7.16(Openssl 0.9.8r)
Windows: curl-7.19(Openssl 0.9.8r)

Since this is crucial please reply as much as possible.

Awaiting your reply.

Regards,

Prabu RM.
* Examining connection #0 for reuse
* Re-using existing connection! (#0) with host s3-rrs-monish.s3.amazonaws.com
* Connected to s3-rrs-monish.s3.amazonaws.com (207.171.163.34) port 443 (#0)
> HEAD 
> /wintest4%2F1%2Fwintest4client%2Ftest17%2F03%5F02%5F2012%5F1134%2F1%2D500%2F1%2FDD18BF3A8E0A2A3E53E2661C7FB53534%2Eori
>  HTTP/1.1
Host: s3-rrs-monish.s3.amazonaws.com
Accept: */*
Date: Fri, 03 Feb 2012 06:12:48 GMT
Authorization: AWS AKIAJKX6F2PV4PWER75Q:UcqS8PrOwQkHwQsvVdoQMiXqCJs=
Content-Length: 1553
Expect: 100-continue

< HTTP/1.1 200 OK
< x-amz-id-2: IfLchToC1zje3iwAiwC591WzhF+N++bClamGF2pUZfpSV6PQeWhH2CtnFcUulsgH
< x-amz-request-id: C36BA9E5CBA0222B
< Date: Fri, 03 Feb 2012 06:16:11 GMT
< Last-Modified: Fri, 03 Feb 2012 06:14:02 GMT
< ETag: "fee521df24fe69e218520f31e6c0b92d"
< Accept-Ranges: bytes
< Content-Type: binary/octet-stream
< Content-Length: 604
< Connection: close
< Server: AmazonS3
Header results:
HTTP/1.1 200 OK
x-amz-id-2: IfLchToC1zje3iwAiwC591WzhF+N++bClamGF2pUZfpSV6PQeWhH2CtnFcUulsgH
x-amz-request-id: C36BA9E5CBA0222B
Date: Fri, 03 Feb 2012 06:16:11 GMT
Last-Modified: Fri, 03 Feb 2012 06:14:02 GMT
ETag: "fee521df24fe69e218520f31e6c0b92d"
Accept-Ranges: bytes
Content-Type: binary/octet-stream
Content-Length: 604
Connection: close
Server: AmazonS3

 Data results:

* Examining connection #0 for reuse
* Re-using existing connection! (#0) with host s3-rrs-monish.s3.amazonaws.com
* Connected to s3-rrs-monish.s3.amazonaws.com (207.171.163.34) port 443 (#0)
> PUT 
> /wintest4%2F1%2Fwintest4client%2Ftest17%2F03%5F02%5F2012%5F1134%2F1%2D500%2F1%2FDD18BF3A8E0A2A3E53E2661C7FB53534%2Ever%5F002
>  HTTP/1.1
Host: s3-rrs-monish.s3.amazonaws.com
Accept: */*
Date: Fri, 03 Feb 2012 06:12:48 GMT
x-amz-storage-class: REDUCED_REDUNDANCY
Content-Length: 515
Authorization: AWS AKIAJKX6F2PV4PWER75Q:WDb0Xb55qonD1ajoBfepXATynQU=
Content-Length: 515
Expect: 100-continue

$$$$$$$$$$$$$$$$$$$$* SSL read: error:00000000:lib(0):func(0):reason(0), errno 
10054
* Connection died, retrying a fresh connect
* Issue another request to this URL: 
'https://s3-rrs-monish.s3.amazonaws.com/wintest4%2F1%2Fwintest4client%2Ftest17%2F03%5F02%5F2012%5F1134%2F1%2D500%
2F1%2FDD18BF3A8E0A2A3E53E2661C7FB53534%2Ever%5F002'
* Examining connection #0 for reuse
* Connection #0 seems to be dead!
* Closing connection #0
* About to connect() to s3-rrs-monish.s3.amazonaws.com port 443 (#0)
*   Trying 72.21.211.168... * connected
* Connected to s3-rrs-monish.s3.amazonaws.com (72.21.211.168) port 443 (#0)
* SSL connection using RC4-MD5
* Server certificate:
*        subject: /C=US/ST=Washington/L=Seattle/O=Amazon.com 
Inc./CN=*.s3.amazonaws.com
*        start date: 2010-12-15 00:00:00 GMT
*        expire date: 2013-12-18 23:59:59 GMT
*        subjectAltName: s3-rrs-monish.s3.amazonaws.com matched
*        issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High 
Assurance CA-3
* SSL certificate verify result: self signed certificate in certificate chain 
(19), continuing anyway.
> PUT 
> /wintest4%2F1%2Fwintest4client%2Ftest17%2F03%5F02%5F2012%5F1134%2F1%2D500%2F1%2FDD18BF3A8E0A2A3E53E2661C7FB53534%2Ever%5F002
>  HTTP/1.1
Host: s3-rrs-monish.s3.amazonaws.com
Accept: */*
Date: Fri, 03 Feb 2012 06:12:48 GMT
x-amz-storage-class: REDUCED_REDUNDANCY
Content-Length: 515
Authorization: AWS AKIAJKX6F2PV4PWER75Q:WDb0Xb55qonD1ajoBfepXATynQU=
Content-Length: 515
Expect: 100-continue

< HTTP/1.1 100 Continue
$$< HTTP/1.1 400 Bad Request
< x-amz-request-id: 41ECE453069ED950
< x-amz-id-2: MCaoqw4KFlotvIlcldcUKkDJZAr+4MAqfibasmCTDVjZBFcyIOg9RJmCRIp6IVCB
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Fri, 03 Feb 2012 06:20:06 GMT
< Connection: close
< Server: AmazonS3
Header results:
HTTP/1.1 100 Continue

HTTP/1.1 400 Bad Request
x-amz-request-id: 41ECE453069ED950
x-amz-id-2: MCaoqw4KFlotvIlcldcUKkDJZAr+4MAqfibasmCTDVjZBFcyIOg9RJmCRIp6IVCB
Content-Type: application/xml
Transfer-Encoding: chunked
Date: Fri, 03 Feb 2012 06:20:06 GMT
Connection: close
Server: AmazonS3


Data results:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>RequestTimeout</Code><Message>Your socket connection to the server 
was not read from or written to within the timeout period. Idle connec
tions will be 
closed.</Message><RequestId>41ECE453069ED950</RequestId><HostId>MCaoqw4KFlotvIlcldcUKkDJZAr+4MAqfibasmCTDVjZBFcyIOg9RJmCRIp6IVCB</HostId
></Error>
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>RequestTimeout</Code><Message>Your socket connection to the server 
was not read from or written to within the timeout period. Idle connec
tions will be 
closed.</Message><RequestId>41ECE453069ED950</RequestId><HostId>MCaoqw4KFlotvIlcldcUKkDJZAr+4MAqfibasmCTDVjZBFcyIOg9RJmCRIp6IVCB</HostId
></Error>

DD18BF3A8E0A2A3E53E2661C7FB53534.ver_002::Could not upload file to S3 with 
Error: Your socket connection to the server was not read from or written to
 within the timeout period. Idle connections will be closed.
#### Returning from process file vector function ####::
StoreGridFileList File Successfully created
#### Replication Files Prepare Started####
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  SIGINT CTRL+C signal  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

C:\Program Files\Vembu\StoreGrid>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to