summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-06-08 18:38:03 +0000
committerOlivier Blin <oblin@mandriva.org>2004-06-08 18:38:03 +0000
commit71c841613becdf120bb4d5187829f3d4c807126d (patch)
tree64f69399c92a1ca814a1a5b0c266615d1750c1c6 /mdk-stage1
parent6ec0928d313947d512db513730710b5f54cc56c9 (diff)
downloaddrakx-71c841613becdf120bb4d5187829f3d4c807126d.tar
drakx-71c841613becdf120bb4d5187829f3d4c807126d.tar.gz
drakx-71c841613becdf120bb4d5187829f3d4c807126d.tar.bz2
drakx-71c841613becdf120bb4d5187829f3d4c807126d.tar.xz
drakx-71c841613becdf120bb4d5187829f3d4c807126d.zip
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
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/url.c4
-rw-r--r--mdk-stage1/url.h1
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);