From eddf96348581ba0c87a82705b1e1422f2bb0f14c Mon Sep 17 00:00:00 2001 From: jkh Date: Tue, 21 Jan 1997 20:37:59 +0000 Subject: Only send QUIT if the last operation didn't time out (otherwise you're just going to hang forever on the close). --- lib/libftpio/ftpio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index b82efaf..7419c37 100644 --- a/lib/libftpio/ftpio.c +++ b/lib/libftpio/ftpio.c @@ -611,8 +611,11 @@ ftp_close(FTP_t ftp) if (ftp->con_state == isopen) { ftp->con_state = quit; - /* Debug("ftp_pkg: in ftp_close(), sending QUIT"); */ - i = cmd(ftp, "QUIT"); + /* If last operation timed out, don't try to quit - just close */ + if (ftp->errno != FTP_TIMED_OUT) + i = cmd(ftp, "QUIT"); + else + i = FTP_QUIT_HAPPY; close(ftp->fd_ctrl); ftp->fd_ctrl = -1; if (check_code(ftp, i, FTP_QUIT_HAPPY)) { -- cgit v1.1