cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: curl error : 52 - help

From: lakshmipriya prabhu <prabhu_priya_at_yahoo.com>
Date: Mon, 2 Oct 2006 13:57:47 -0700 (PDT)

Hi Dan,
   
  The request sent by the browser as well as the libcurl script is only POST /ABC/Upload.asp?pqr=1 HTTP/1.1
The next step in both cases, involves a redirection and GET /ABC/Upload.asp?pqr=2 HTTP/1.1
   
  
So both the requests are same.I have attached the redirection and GET in case of browser { which was missed in the previous message }also for your reference.
   
  Please also find the details :
  - Version & OS :- libcurl version 7.15.3 and OS Windows XP 2000, Also tried with libcurl version 7.15.4 { gives the same problem }
- command line url cannot be used in this application as it involves regular expression usage for (Results display using pagination) which i do using PHP reg ex functions.
   
  Please find the correct trace :
   
  _______________________________________________
   
  ========== BROWSER TRACE ===========================
  POST /ABC/Upload.asp?pqr=1 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: https://abc.def.ghi/ABC/Upload.asp?frompage=fromaspnet.asp
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: abc.def.ghi
Content-Length: 124
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ASP.NET_SessionId=oqsrg0fzyi04l255yludwi55; ASPSESSIONIDQQQBBDAQ=FJMFABKCPBLBDKEJDOACACMC
  txtLines=0&optType=1&Delimiter=%2C&txtDelimiter=&Qualifier=%22&txtQualifier=&cmdSubmit.x=54&cmdSubmit.y=20
  HTTP/1.1 302 Object moved
Connection: close
Date: Fri, 29 Sep 2006 22:36:04 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Location: Upload.asp?pqr=2
Content-Length: 144
Content-Type: text/html
Cache-control: private
  <head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found here.</body>
  
GET /ABC/Upload.asp?pqr=2 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: https://abc.def.ghi/ABC/Upload.asp?frompage=fromaspnet.asp
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: abc.def.ghi
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ASP.NET_SessionId=n3xsecjesmhjrrf1qdepmp45; ASPSESSIONIDQQQACABQ=KLJLJAKAHFDAGOMIEFKGNJDM
  
HTTP/1.1 200 OK
Connection: close
Date: Fri, 29 Sep 2006 22:36:05 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Length: 31863
Content-Type: text/html
Cache-control: private
  ========== BROWSER TRACE ============================
  ********** LIBCURL(SCRIPTS) TRACE **************************************
 ENTER STEP #######*
About to connect() to abc.def.ghi port 443
* Trying aaa.bbb.cc.ddd... * connected
* Connected to abc.def.ghi (aaa.bbb.cc.ddd) port 443
* SSL connection using DES-CBC3-MD5
> POST /ABC/Upload.asp?pqr=1 HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1
.4322)
Host: abc.def.ghi
Accept: */*
Referer: https://abc.def.ghi/ABC/Upload.asp?frompage=fromaspnet.asp
Cookie: ASPSESSIONIDQQQBBDAQ=KJMFABKCLGPICEBANFDBLFCH; ASP.NET_SessionId=isliqa4
5maky2hejbpr1tw55
Content-Length: 124
Content-Type: application/x-www-form-urlencoded
  txtLines=0&optType=1&Delimiter=%2C&txtDelimiter=&Qualifier=%22&txtQualifier=&cmdSubmit.x=54&cmdSubmit.y=20< HTTP/1.1 302 Object moved
< Connection: close
< Date: Sat, 30 Sep 2006 00:04:18 GMT
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< Location: Upload.asp?pqr=2
< Content-Length: 144
< Content-Type: text/html
< Cache-control: private
* Closing connection #0
* Issue another request to this URL: 'https://abc.def.ghi/ABC/Upload.asp?pqr=2'
* Disables POST, goes with GET
* About to connect() to abc.def.ghi port 443
* Trying aaa.bbb.cc.ddd... * connected
* Connected to abc.def.ghi (aaa.bbb.cc.ddd) port 443
* SSL re-using session ID
* SSL connection using DES-CBC3-MD5
> GET /ABC/Upload.asp?pqr=2 HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1
.4322)
Host: abc.def.ghi
Accept: */*
Referer: https://abc.def.ghi/ABC/Upload.asp?frompage=fromaspnet.asp
Cookie: ASPSESSIONIDQQQBBDAQ=KJMFABKCLGPICEBANFDBLFCH; ASP.NET_SessionId=isliqa4
5maky2hejbpr1tw55
  * Empty reply from server
* Connection #0 to host abc.def.ghi left intact
Array
(
    [url] => https://abc.def.ghi/ABC/Upload.asp?pqr=2
    [content_type] => text/html
    [http_code] => 302
    [header_size] => 240
    [request_size] => 905
    [filetime] => -1
    [ssl_verify_result] => 20
    [redirect_count] => 1
    [total_time] => 1.422
    [namelookup_time] => 0
    [connect_time] => 0.094
    [pretransfer_time] => 0.281
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => 144
    [upload_content_length] => 0
    [starttransfer_time] => 0.5
    [redirect_time] => 0.922
)
  
cURL error number:52
  cURL error:Empty reply from server* Closing connection #0
  EXIT STEP #######
  ********** LIBCURL TRACE **************************************
   
   
  _______________________________________________
   
   
  Please suggest what might be the cause of this problem.
   
  Thanks again,
  LP

Daniel Stenberg <daniel_at_haxx.se> wrote:
  On Mon, 2 Oct 2006, lakshmipriya prabhu wrote:

> cURL error number :52

This is typically because the server is being stupid. It should never just not
reply anything when using HTTP.

> 1) The Request is same as Browser Request

They're not. Your example shows the browser NOT following the redirect while
your libcurl request did, so of course the browser didn't find the problem
with the target URL since it didn't get it...

Also, you didn't mention what libcurl version you use, on what operating
system it runs or if you can make this work with the command line tool.

-- 
Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
 		
---------------------------------
 All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-10-02