when getting a FTP file with NOBODY, we will no longer return error if
authorDaniel Stenberg <daniel@haxx.se>
Tue, 8 May 2001 12:10:14 +0000 (12:10 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 8 May 2001 12:10:14 +0000 (12:10 +0000)
SIZE doesn't work, we just don't output any size info!

lib/ftp.c

index e634fa6..2629c07 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -848,35 +848,34 @@ CURLcode _ftp(struct connectdata *conn)
     if(nread < 0)
       return CURLE_OPERATION_TIMEOUTED;
 
-    if(ftpcode != 213) {
-      failf(data, "Couldn't get file size: %s", buf+4);
-      return CURLE_FTP_COULDNT_GET_SIZE;
-    }
-    /* get the size from the ascii string: */
-    filesize = atoi(buf+4);
+    if(ftpcode == 213) {
 
-    sprintf(buf, "Content-Length: %d\r\n", filesize);
-    result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
-    if(result)
-      return result;
+      /* get the size from the ascii string: */
+      filesize = atoi(buf+4);
+
+      sprintf(buf, "Content-Length: %d\r\n", filesize);
+      result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
+      if(result)
+        return result;
 
 #ifdef HAVE_STRFTIME
-    if(data->bits.get_filetime && data->progress.filetime) {
-      struct tm *tm;
+      if(data->bits.get_filetime && data->progress.filetime) {
+        struct tm *tm;
 #ifdef HAVE_LOCALTIME_R
-      struct tm buffer;
-      tm = (struct tm *)localtime_r(&data->progress.filetime, &buffer);
+        struct tm buffer;
+        tm = (struct tm *)localtime_r(&data->progress.filetime, &buffer);
 #else
-      tm = localtime(&data->progress.filetime);
+        tm = localtime(&data->progress.filetime);
 #endif
-      /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
-      strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S %Z\r\n",
-               tm);
-      result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
-      if(result)
-        return result;
-    }
+        /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
+        strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S %Z\r\n",
+                 tm);
+        result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
+        if(result)
+          return result;
+      }
 #endif
+    }
 
     return CURLE_OK;
   }