Browse Source

[ftp] Terminate processing after receiving an error

When an error reply (not 1xx, 2xx or 3xx) was received, ftp_reply()
invoked ftp_done() to close connections, but did not return, and the
rest of code in this function could try to send commands to the closed
control connection.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
tags/v0.9.4
Sergey Vlasov 16 years ago
parent
commit
e6cd16946a
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      src/net/tcp/ftp.c

+ 1
- 0
src/net/tcp/ftp.c View File

221
 		 ( ( status_major == '3' ) && ( ftp->state == FTP_USER ) ) ) ){
221
 		 ( ( status_major == '3' ) && ( ftp->state == FTP_USER ) ) ) ){
222
 		/* Flag protocol error and close connections */
222
 		/* Flag protocol error and close connections */
223
 		ftp_done ( ftp, -EPROTO );
223
 		ftp_done ( ftp, -EPROTO );
224
+		return;
224
 	}
225
 	}
225
 
226
 
226
 	/* Open passive connection when we get "PASV" response */
227
 	/* Open passive connection when we get "PASV" response */

Loading…
Cancel
Save