summaryrefslogtreecommitdiff
path: root/libftpconn
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-09-02 22:31:06 +0000
committerMiles Bader <miles@gnu.org>1997-09-02 22:31:06 +0000
commitb7f616615a7b65bb536802bcd1650d5bdb57bb37 (patch)
treedc710d66a784bc1525e3ddba1ae8c12015d19792 /libftpconn
parent2d40ebe2d900c6ec23885459dffb74111b114553 (diff)
(ftp_conn_close):
Close CONN->actv_data_conn_queue if necessary. (ftp_conn_open): Set SIN_LEN field correctly.
Diffstat (limited to 'libftpconn')
-rw-r--r--libftpconn/open.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libftpconn/open.c b/libftpconn/open.c
index 2a1b1b98..93ab0ac8 100644
--- a/libftpconn/open.c
+++ b/libftpconn/open.c
@@ -187,7 +187,7 @@ ftp_conn_open (struct ftp_conn *conn)
if (csock < 0)
return errno;
- ftp_addr.sin_len = conn->params->addr_len;
+ ftp_addr.sin_len = sizeof ftp_addr;
ftp_addr.sin_family = conn->params->addr_type;
ftp_addr.sin_addr = *(struct in_addr *)conn->params->addr;
ftp_addr.sin_port = ftp_port;
@@ -235,6 +235,9 @@ ftp_conn_close (struct ftp_conn *conn)
if (conn->control >= 0)
close (conn->control);
conn->control = -1;
+ if (conn->actv_data_conn_queue >= 0)
+ close (conn->actv_data_conn_queue);
+ conn->actv_data_conn_queue = -1;
if (conn->hooks && conn->hooks->closed)
(* conn->hooks->closed) (conn);
}