cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-784995 ] --fail doesn't work

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sat, 09 Sep 2006 19:39:19 -0700

Bugs item #784995, was opened at 2003-08-07 16:44
Message generated for change (Comment added) made by pulseczar
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=784995&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: http
Group: wrong behaviour
Status: Closed
Resolution: Works For Me
Priority: 5
Submitted By: Piotr Hosowicz (lodzislaw)
Assigned to: Daniel Stenberg (bagder)
Summary: --fail doesn't work

Initial Comment:
This issue concerns the same case (server and file)
that I mentioned in the issue with --time-cond today.

--fail option doesn't work, I think. I do :

curl --fail .... other options .... url

... and I get $? = 0, despite that the file doesn't
exist on the server (I am sure of that, when I browse
the inexistent URL with Lynx I get 404 response). The
headers are the same, as I gave with the --time-cond issue.

Regards,

Piotr Hosowicz

----------------------------------------------------------------------

Comment By: Pulseczar (pulseczar)
Date: 2006-09-09 22:39

Message:
Logged In: YES
user_id=1480496

I could not get --fail to work either. When using cURL to
download multiple files, --fail is supposed to keep cURL
from 'downloading' non-existent files, on 404 errors. But
when I use --fail or -f, it still makes those files. I've
tried it on both Cygwin cURL and Win32 cURL.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2003-08-11 18:35

Message:
Logged In: YES
user_id=1110

No bug, closed report.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2003-08-08 09:10

Message:
Logged In: YES
user_id=1110

So, slap on a -v and the truth is revealed:

I did this

$ curl --location --fail
http://download.mks.com.pl/download/linux/bazy4.tgzxxoioix -v

It turns out that this server doesn't return errors on
missing files, it returns a 200 OK (after first following a
location:) and curl cannot know that means the file doesn't
exist. This server is badly configured.

So, do you have any other URL that makes --fail fail?

----------------------------------------------------------------------

Comment By: Piotr Hosowicz (lodzislaw)
Date: 2003-08-08 09:03

Message:
Logged In: YES
user_id=839882

Following is a snip of the script that I wrote yesterday, it
is an attempt to download antivirus database. Notice, that
the URL has a &quot;spoiler&quot; in the file's extension, so the curl
with --fail should return a nonzero return value. This is
how I understood the man page for curl. But it does return 0.

# ----------- this is the snip

#!/bin/bash

URL=http://download.mks.com.pl/download/linux/bazy4.tgzxxx
BASEDIR=/var/mksvir
LOGFILE=/var/log/mks-update.log

cd $BASEDIR
# download
echo 'DOWNLOAD : ' $(date) &gt;&gt; $LOGFILE
curl --location --fail --remote-time --output
./bazy4.tgz.tmp --url $URL 2&gt;&amp;1 &gt;&gt; $LOGFILE
echo $?

# .... cut the rest (irrelevant to the issue)

# --------------------------

I didn't test the second issue yet (with the --time-cond
switch). The problem persists, despite I upgraded from 7.9.8
to 7.10.6-1.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2003-08-08 04:17

Message:
Logged In: YES
user_id=1110

Again, give me a full command line showing this. I've had a
test case in the test suite (that tests exactly a case like
this) for quite some time and it has worked fine all that
time...

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=784995&group_id=976
Received on 2006-09-10

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET