]> sjero.net Git - wget/blobdiff - src/ftp.c
[svn] Merge of fix for bugs 20341 and 20410.
[wget] / src / ftp.c
index ca07dfbbb775797e5c2afc68dba5a1ac323dc591..2e32c1f03d04b45e9f723706d8e8d7ac1567925d 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -5,7 +5,7 @@ This file is part of GNU Wget.
 
 GNU Wget is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 
 GNU Wget is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with Wget; if not, write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+along with Wget.  If not, see <http://www.gnu.org/licenses/>.
 
 In addition, as a special exception, the Free Software Foundation
 gives permission to link the code of its release of Wget with the
@@ -37,6 +36,7 @@ so, delete this exception statement from your version.  */
 #endif
 #include <assert.h>
 #include <errno.h>
+#include <time.h>
 
 #include "wget.h"
 #include "utils.h"
@@ -967,7 +967,7 @@ Error in server response, closing control connection.\n"));
                      expected_bytes ? expected_bytes - restval : 0,
                      restval, &rd_size, len, &con->dltime, flags);
 
-  tms = time_str (NULL);
+  tms = time_str (time (NULL));
   tmrate = retr_rate (rd_size, con->dltime);
   total_download_time += con->dltime;
 
@@ -1149,7 +1149,7 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
        restval = 0;
 
       /* Get the current time string.  */
-      tms = time_str (NULL);
+      tms = time_str (time (NULL));
       /* Print fetch message, if opt.verbose.  */
       if (opt.verbose)
        {
@@ -1172,7 +1172,7 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
        len = 0;
       err = getftp (u, &len, restval, con);
 
-      if (con->csock != -1)
+      if (con->csock == -1)
        con->st &= ~DONE_CWD;
       else
        con->st |= DONE_CWD;
@@ -1213,7 +1213,7 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
          /* Not as great.  */
          abort ();
        }
-      tms = time_str (NULL);
+      tms = time_str (time (NULL));
       if (!opt.spider)
         tmrate = retr_rate (len - restval, con->dltime);