]> sjero.net Git - wget/commitdiff
Make wget abort if --post-file does not exist
authorDarshit Shah <darnir@gmail.com>
Tue, 12 Mar 2013 07:41:04 +0000 (13:11 +0530)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 14 Mar 2013 20:19:13 +0000 (21:19 +0100)
Signed-off-by: Darshit Shah <darnir@gmail.com>
src/ChangeLog
src/exits.c
src/http.c

index c37fb85a5cffec66e84663ea1b23992cfd4b0836..8e1213f1a4c1ae382ee1a70b53d7f65d5662277f 100644 (file)
@@ -1,6 +1,15 @@
+2013-03-12  Darshit Shah <darnir@gmail.com>
+
+       * http.c (gethttp): Make wget return FILEBADFILE error and abort if
+       post-file does not exist.
+
+       * http.c (http_loop): Handle FILEBADFILE as a valid err.
+
+       * exits.c (get_status_for_err): Mark FILEBADFILE as an IO error.
+
 2013-02-15  Darshit Shah <darnir@gmail.com>
 
-       * cookies.c (cookie_handle_set_cookie): Set cookie-descard_requested
+       * cookies.c (cookie_handle_set_cookie): Set cookie->discard_requested
        to true on domain mismatch.
 
 2012-12-20  Tim Ruehsen  <tim.ruehsen@gmx.de>
index e23fc1c94d24c0bc61bfcdc0fe2533b19cc22058..cea38d5c9c2134fb930d1fbc83b6cb5fec206dc9 100644 (file)
@@ -58,7 +58,7 @@ get_status_for_err (uerr_t err)
     case RETROK:
       return WGET_EXIT_SUCCESS;
     case FOPENERR: case FOPEN_EXCL_ERR: case FWRITEERR: case WRITEFAILED:
-    case UNLINKERR: case CLOSEFAILED:
+    case UNLINKERR: case CLOSEFAILED: case FILEBADFILE:
       return WGET_EXIT_IO_FAIL;
     case NOCONERROR: case HOSTERR: case CONSOCKERR: case CONERROR:
     case CONSSLERR: case CONIMPOSSIBLE: case FTPRERR: case FTPINVPASV:
index fdb0d7e4b485ad3994ef84fce9fedd80630c6def..b393e248bb17ebe280e6818cc09ade0cad28b620 100644 (file)
@@ -1865,7 +1865,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
             {
               logprintf (LOG_NOTQUIET, _("POST data file %s missing: %s\n"),
                          quote (opt.post_file_name), strerror (errno));
-              post_data_size = 0;
+              return FILEBADFILE;
             }
         }
       request_set_header (req, "Content-Length",
@@ -3119,6 +3119,7 @@ Spider mode enabled. Check if remote file exists.\n"));
                      quote (hstat.local_file), strerror (errno));
         case HOSTERR: case CONIMPOSSIBLE: case PROXERR: case AUTHFAILED:
         case SSLINITFAILED: case CONTNOTSUPPORTED: case VERIFCERTERR:
+        case FILEBADFILE:
           /* Fatal errors just return from the function.  */
           ret = err;
           goto exit;