X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fftp.c;h=25f05a4c7e3944ea538082637cab693e7e5c349c;hp=c2522ca173baf8f6d84d42e395c4829b3ab9dc14;hb=38a7829dcb4eb5dba28dbf0f05c6a80fea9217f8;hpb=c3835a425a2b441dd741c7edc1684310141fb385 diff --git a/src/ftp.c b/src/ftp.c index c2522ca1..25f05a4c 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -802,8 +802,12 @@ Error in server response, closing control connection.\n")); abort (); } if (!opt.server_response) - logprintf (LOG_VERBOSE, expected_bytes ? "%s\n" : _("done.\n"), - number_to_static_string (expected_bytes)); + { + logprintf (LOG_VERBOSE, "%s\n", + expected_bytes ? + number_to_static_string (expected_bytes) : + _("done.\n")); + } } if (cmd & DO_RETR && restval > 0 && restval == expected_bytes) @@ -986,15 +990,14 @@ Error in server response, closing control connection.\n")); if (opt.spider) { bool exists = false; - uerr_t res; struct fileinfo *f; - res = ftp_get_listing (u, con, &f); + uerr_t _res = ftp_get_listing (u, con, &f); /* Set the DO_RETR command flag again, because it gets unset when calling ftp_get_listing() and would otherwise cause an assertion failure earlier on when this function gets repeatedly called (e.g., when recursing). */ con->cmd |= DO_RETR; - if (res == RETROK) + if (_res == RETROK) { while (f) { @@ -1231,8 +1234,7 @@ Error in server response, closing control connection.\n")); { if (opt.unlink && file_exists_p (con->target)) { - int res = unlink (con->target); - if (res < 0) + if (unlink (con->target) < 0) { logprintf (LOG_NOTQUIET, "%s: %s\n", con->target, strerror (errno)); @@ -1306,7 +1308,7 @@ Error in server response, closing control connection.\n")); if (restval && rest_failed) flags |= rb_skip_startpos; rd_size = 0; - res = fd_read_body (dtsock, fp, + res = fd_read_body (con->target, dtsock, fp, expected_bytes ? expected_bytes - restval : 0, restval, &rd_size, qtyread, &con->dltime, flags, warc_tmp); @@ -1632,6 +1634,8 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con, char **local_fi /* Decide whether or not to restart. */ if (con->cmd & DO_LIST) restval = 0; + else if (opt.start_pos >= 0) + restval = opt.start_pos; else if (opt.always_rest && stat (locf, &st) == 0 && S_ISREG (st.st_mode))