mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 23:48:09 +01:00
Only send QUIT if the last operation didn't time out (otherwise you're
just going to hang forever on the close).
This commit is contained in:
parent
93e808cd76
commit
b5b673ff99
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21930
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user