Commit cde5e35d authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Fixed CURLOPT_FAILONERROR to return CURLE_HTTP_RETURNED_ERROR even for the

case when 401 or 407 are returned, *IF* no auth credentials have been given.
The CURLOPT_FAILONERROR option is not possible to make fool-proof for 401
and 407 cases when auth credentials is given, but we've now covered this
somewhat more.

You might get some amounts of headers transferred before this situation is
detected, like for when a "100-continue" is received as a response to a
POST/PUT and a 401 or 407 is received immediately afterwards.

Added test 281 to verify this change.
parent ee17fba7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -6,6 +6,19 @@

                                  Changelog

Daniel (25 October 2006)
- Fixed CURLOPT_FAILONERROR to return CURLE_HTTP_RETURNED_ERROR even for the
  case when 401 or 407 are returned, *IF* no auth credentials have been given.
  The CURLOPT_FAILONERROR option is not possible to make fool-proof for 401
  and 407 cases when auth credentials is given, but we've now covered this
  somewhat more.

  You might get some amounts of headers transferred before this situation is
  detected, like for when a "100-continue" is received as a response to a
  POST/PUT and a 401 or 407 is received immediately afterwards.

  Added test 281 to verify this change.

Daniel (23 October 2006)
- Ravi Pratap provided a major update with pipelining fixes. We also no longer
  re-use connections (for pipelining) before the name resolving is done.
+4 −3
Original line number Diff line number Diff line
@@ -12,9 +12,9 @@ Curl and libcurl 7.16.0
This release includes the following changes:
 
 o Added CURLE_SSL_CACERT_BADFILE
 o Added CURLMOPT_TIMERFUNCTION
 o The CURLOPT_SOURCE_* options are removed and so are the --3p* command line
   options
 o Added CURLMOPT_TIMERFUNCTION and CURLMOPT_TIMERDATA
 o (FTP) the CURLOPT_SOURCE_* options are removed and so are the --3p* command
   line options
 o curl_multi_socket() and family are suitable to start using
 o uses WSAPoll() on Windows Vista
 o (FTP) --ftp-ssl-control was added
@@ -28,6 +28,7 @@ This release includes the following changes:

This release includes the following bugfixes:

 o (HTTP) CURLOPT_FAILONERROR (curl -f) covers a few more reponse cases
 o curl_multi_socket() and the LOW_SPEED options
 o curl_multi_socket() expire timer during c-ares name resolves
 o curl_multi_add_handle on an already added handle now fails gracefully
+4 −0
Original line number Diff line number Diff line
@@ -359,6 +359,10 @@ normal cases when a HTTP server fails to deliver a document, it returns an
HTML document stating so (which often also describes why and more). This flag
will prevent curl from outputting that and return error 22.

This method is not fail-safe and there are occasions where non-succesful
response codes will slip through, especially when authentication is involved
(response codes 401 and 407).

If this option is used twice, the second will again disable silent failure.
.IP "--ftp-account [data]"
(FTP) When an FTP server asks for "account data" after user name and password
+8 −0
Original line number Diff line number Diff line
@@ -344,6 +344,14 @@ when showing the progress meter and displaying \fICURLOPT_VERBOSE\fP data.
A non-zero parameter tells the library to fail silently if the HTTP code
returned is equal to or larger than 400. The default action would be to return
the page normally, ignoring that code.

This method is not fail-safe and there are occasions where non-succesful
response codes will slip through, especially when authentication is involved
(response codes 401 and 407).

You might get some amounts of headers transferred before this situation is
detected, like for when a "100-continue" is received as a response to a
POST/PUT and a 401 or 407 is received immediately afterwards.
.SH NETWORK OPTIONS
.IP CURLOPT_URL
The actual URL to deal with. The parameter should be a char * to a zero
+3 −4
Original line number Diff line number Diff line
@@ -675,10 +675,9 @@ CURLcode Curl_readwrite(struct connectdata *conn,
                 * depending on how authentication is working.  Other codes
                 * are definitely errors, so give up here.
                 */
                if (data->set.http_fail_on_error &&
                    (k->httpcode >= 400) &&
                    (k->httpcode != 401) &&
                    (k->httpcode != 407)) {
                if (data->set.http_fail_on_error && (k->httpcode >= 400) &&
                    ((k->httpcode != 401) || !data->set.userpwd) &&
                    ((k->httpcode != 407) || !data->set.proxyuserpwd) ) {

                  if (data->reqdata.resume_from &&
                      (data->set.httpreq==HTTPREQ_GET) &&
Loading