From 7139845af98013fc589b49887211a8c0a8ec88b7 Mon Sep 17 00:00:00 2001 From: Vlad Krupin Date: Mon, 18 Mar 2002 22:26:32 +0000 Subject: [PATCH] Fix ftp_size() returning bogus results. # make sure the server is in BINARY mode before requesting file size. --- ext/ftp/ftp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index b41367926ae..d7d7d8a8f1f 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -685,6 +685,8 @@ ftp_size(ftpbuf_t *ftp, const char *path) if (ftp == NULL) return -1; + if (!ftp_type(ftp, FTPTYPE_IMAGE)) + return -1; if (!ftp_putcmd(ftp, "SIZE", path)) return -1; if (!ftp_getresp(ftp) || ftp->resp != 213)