diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2012-11-15 23:53:12 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2012-11-15 23:53:12 -0500 |
commit | cfe3405e9a93b2af0a0228799ab2b9d3f4b6d218 (patch) | |
tree | 2af73e2881d3882363b6d13d165d44ae47ee0c6a /WWW/Library | |
parent | 679bd95b15c819b91e85d2f3fe38468f1d45a3c7 (diff) | |
download | lynx-snapshots-cfe3405e9a93b2af0a0228799ab2b9d3f4b6d218.tar.gz |
snapshot of project "lynx", label v2-8-8dev_14g
Diffstat (limited to 'WWW/Library')
-rw-r--r-- | WWW/Library/Implementation/HTFTP.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 5b346f3f..e8dea73b 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFTP.c,v 1.104 2012/08/15 23:14:42 tom Exp $ + * $LynxId: HTFTP.c,v 1.106 2012/11/15 23:51:23 tom Exp $ * * File Transfer Protocol (FTP) Client * for a WorldWideWeb browser @@ -4007,6 +4007,22 @@ int HTFTPLoad(const char *name, * dealing with if we don't know yet. - FM */ if (!(type) || (type && *type != 'D')) { + /* + * If we are retrieving a file we will (except for CMS) use + * binary mode, which lets us use the size command supported by + * ftp servers which implement RFC 3659. Knowing the size lets + * us in turn display ETA in the progress message -TD + */ + if (control->binary) { + int code; + off_t size; + + status = send_cmd_2("SIZE", filename); + if (status == 2 && + sscanf(response_text, "%d %" PRI_off_t, &code, &size) == 2) { + anchor->content_length = size; + } + } status = send_cmd_2("RETR", filename); if (status >= 5) { int check; @@ -4078,11 +4094,6 @@ int HTFTPLoad(const char *name, CTRACE((tfp, "TCP: Accepted new socket %d\n", status)); data_soc = status; } - /* !ftp_local_passive */ -#if 0 /* no - this makes the data connection go away too soon (2.8.3dev.22) */ - if ((status = send_cmd_nowait("QUIT")) == 1) - outstanding++; -#endif if (isDirectory) { if (server_type == UNIX_SERVER && !unsure_type && @@ -4170,13 +4181,6 @@ int HTFTPLoad(const char *name, /* Reset buffering to control connection DD 921208 */ if (rv < 0) { -#if 0 /* any known servers where ABOR would work this way? */ - if (rv == HT_INTERRUPTED || rv == -501) - if (send_cmd_nowait("ABOR") == 1) { - outstanding++; - CTRACE((tfp, "HTFTP: outstanding responses: %d\n", outstanding)); - } -#endif if (rv == -2) /* weird error, don't expect much response */ outstanding--; else if (rv == HT_INTERRUPTED || rv == -1) |