curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Identical call from Perl does not work

From: ToddAndMargo <ToddAndMargo_at_zoho.com>
Date: Fri, 31 May 2019 19:41:32 -0700

Hi All,

Fedora 30
curl-7.64.0-6.fc30.x86_64

I wrote a Perl 6 module that interfaces with curl. If
I send it "-v", its prints out the run string and
the -v data as well.

On this "one" site, I can not figure out why I can run the
echo'ed command from the command line but download an error
report when running it from Perl.

What the heck?

-T

Below is the verbose from Perl and the command line. The
command line is a copy and paste from Perl's output.

~~~~~~~~~~~~~~~~~~~~~~~

Does not work from Perl:

curl --referer 'http://www.almico.com/sfdownload.php' --connect-timeout
6600 -L -v http://www.almico.com/instspeedfan452.exe -o
/home/CDs/Windows/SystemTools/FanSpeedAndTemperature/SpeedFan-4.52.exe
   % Total % Received % Xferd Average Speed Time Time Time
Current
                                  Dload Upload Total Spent Left
Speed
   0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0* Trying 148.251.82.37...
* TCP_NODELAY set
* Connected to www.almico.com (148.251.82.37) port 80 (#0)
> GET /instspeedfan452.exe HTTP/1.1
> Host: www.almico.com
> User-Agent: curl/7.64.0
> Accept: */*
> Referer: 'http://www.almico.com/sfdownload.php'
>
< HTTP/1.1 302 Found
< Date: Sat, 01 Jun 2019 02:25:21 GMT
< Server: Apache
< X-Frame-Options: SAMEORIGIN
< Location: http://www.almico.com/sfdownload.php
< Cache-Control: max-age=86400
< Expires: Sun, 02 Jun 2019 02:25:21 GMT
< Content-Length: 220
< Content-Type: text/html; charset=iso-8859-1
<
* Ignoring the response-body
{ [220 bytes data]
100 220 100 220 0 0 451 0 --:--:-- --:--:-- --:--:--
   450
* Connection #0 to host www.almico.com left intact
* Issue another request to this URL: 'http://www.almico.com/sfdownload.php'
* Found bundle for host www.almico.com: 0x55a4533da870 [can pipeline]
* Could pipeline, but not asked to!
* Re-using existing connection! (#0) with host www.almico.com
* Connected to www.almico.com (148.251.82.37) port 80 (#0)
> GET /sfdownload.php HTTP/1.1
> Host: www.almico.com
> User-Agent: curl/7.64.0
> Accept: */*
> Referer: 'http://www.almico.com/sfdownload.php'
>
< HTTP/1.1 200 OK
< Date: Sat, 01 Jun 2019 02:25:21 GMT
< Server: Apache
< X-Frame-Options: SAMEORIGIN
< X-Powered-By: PHP/5.4.16
< Vary: User-Agent,Accept-Encoding
< Cache-control: no-cache, max-age=86400
< Set-Cookie: CookieUserId=-1; expires=Mon, 01-Jul-2019 02:25:21 GMT
< Expires: Sun, 02 Jun 2019 02:25:21 GMT
< X-Content-Type-Options: nosniff
< x-xss-protection: 1; mode=block
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=ISO-8859-1
<
{ [1004 bytes data]
100 16922 0 16922 0 0 19884 0 --:--:-- --:--:-- --:--:--
19884
* Connection #0 to host www.almico.com left intact

~~~~~~~~~~~~~~~~~~~~~~~

Works (Command line):
$ curl --referer 'http://www.almico.com/sfdownload.php'
--connect-timeout 6600 -L -v http://www.almico.com/instspeedfan452.exe
-o /home/CDs/Windows/SystemTools/FanSpeedAndTemperature/SpeedFan-4.52.exe
   % Total % Received % Xferd Average Speed Time Time Time
Current
                                  Dload Upload Total Spent Left
Speed
   0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0* Trying 148.251.82.37...
* TCP_NODELAY set
* Connected to www.almico.com (148.251.82.37) port 80 (#0)
   0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0> GET /instspeedfan452.exe HTTP/1.1
> Host: www.almico.com
> User-Agent: curl/7.64.0
> Accept: */*
> Referer: http://www.almico.com/sfdownload.php
>
< HTTP/1.1 200 OK
< Date: Sat, 01 Jun 2019 02:27:32 GMT
< Server: Apache
< X-Frame-Options: SAMEORIGIN
< Last-Modified: Wed, 29 Jun 2016 18:31:14 GMT
< Accept-Ranges: bytes
< Content-Length: 3086696
< Cache-Control: max-age=86400
< Expires: Sun, 02 Jun 2019 02:27:32 GMT
< X-Content-Type-Options: nosniff
< x-xss-protection: 1; mode=block
< Content-Type: application/octet-stream
<
{ [1082 bytes data]
100 3014k 100 3014k 0 0 664k 0 0:00:04 0:00:04 --:--:--
  690k
* Connection #0 to host www.almico.com left intact

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-06-01