aboutsummaryrefslogtreecommitdiff
path: root/lib/libftpio/ftpio.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1997-01-21 20:37:59 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1997-01-21 20:37:59 +0000
commitb5b673ff993e74b6db9b6d437e7a438f032cf9c5 (patch)
treecf540d51f1a11443d8086ce35b3d1a414d62bc79 /lib/libftpio/ftpio.c
parent93e808cd76cc728ac4dbeadbd6a72e1121b0f83c (diff)
downloadsrc-b5b673ff993e74b6db9b6d437e7a438f032cf9c5.tar.gz
src-b5b673ff993e74b6db9b6d437e7a438f032cf9c5.zip
Only send QUIT if the last operation didn't time out (otherwise you're
just going to hang forever on the close).
Notes
Notes: svn path=/head/; revision=21930
Diffstat (limited to 'lib/libftpio/ftpio.c')
-rw-r--r--lib/libftpio/ftpio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c
index b82efaf69559..7419c37717b4 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)) {