From 71c841613becdf120bb4d5187829f3d4c807126d Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 8 Jun 2004 18:38:03 +0000 Subject: list only the requested file in ftp_get_filesize() instead of the whole directory (the buffer happens to be too small sometimes), make this function available for other modules --- mdk-stage1/url.c | 4 ++-- mdk-stage1/url.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mdk-stage1/url.c b/mdk-stage1/url.c index 0c4dbbedf..45318fc54 100644 --- a/mdk-stage1/url.c +++ b/mdk-stage1/url.c @@ -309,7 +309,7 @@ int ftp_data_command(int sock, char * command, char * param) } -static int ftp_get_filesize(int sock, char * remotename) +int ftp_get_filesize(int sock, char * remotename) { int size = 0; char buf[2000]; @@ -330,7 +330,7 @@ static int ftp_get_filesize(int sock, char * remotename) return -1; } - fd = ftp_data_command(sock, "LIST", NULL); + fd = ftp_data_command(sock, "LIST", file); if (fd <= 0) { close(sock); return -1; diff --git a/mdk-stage1/url.h b/mdk-stage1/url.h index d4f7f3992..2397242a5 100644 --- a/mdk-stage1/url.h +++ b/mdk-stage1/url.h @@ -23,6 +23,7 @@ #define _URL_H_ int ftp_open_connection(char * host, char * name, char * password, char * proxy); +int ftp_get_filesize(int sock, char * remotename); int ftp_start_download(int sock, char * remotename, int * size); int ftp_end_data_command(int sock); -- cgit v1.2.1