Mercurial > gftp.yaz
diff lib/protocols.c @ 169:d40f9db52cdf
2003-6-8 Brian Masney <masneyb@gftp.org>
* lib/https.c lib/options.h lib/sslcommon.c - make sure USE_SSL is
defined before using any SSL functions
* lib/gftp.h lib/protocols.c lib/rfc2068.c lib/sshv2.c lib/sslcommon.c
lib/rfc959.c - make sure we use request->datafd for the connection. Removed
sockfd from gftp_request structure
* lib/rfc959.c - add data_connection to rfc959_parms structure. Use
this for the FTP data connection
* src/text/gftp-text.c - fixes for username/password prompt
* src/gtk/misc-gtk.c src/gtk/transfer.c - s/sockfd/datafd/g
* configure.in - added lib/Makefile (forgot to commit last time)
* Makefile.am - added intl to SUBDIRS
author | masneyb |
---|---|
date | Sun, 08 Jun 2003 15:49:02 +0000 |
parents | c505d9ba9d53 |
children | 4c288d05b26a |
line wrap: on
line diff
--- a/lib/protocols.c Sun Jun 08 15:04:40 2003 +0000 +++ b/lib/protocols.c Sun Jun 08 15:49:02 2003 +0000 @@ -26,7 +26,6 @@ gftp_request *request; request = g_malloc0 (sizeof (*request)); - request->sockfd = -1; request->datafd = -1; request->cachefd = -1; request->server_type = GFTP_DIRTYPE_OTHER; @@ -71,7 +70,6 @@ g_free (request); else { - request->sockfd = -1; request->datafd = -1; request->cachefd = -1; } @@ -611,7 +609,11 @@ if (request->username) g_free (request->username); - request->username = g_strdup (username); + + if (username != NULL) + request->username = g_strdup (username); + else + request->username = NULL; } @@ -623,7 +625,11 @@ if (request->password) g_free (request->password); - request->password = g_strdup (password); + + if (password != NULL) + request->password = g_strdup (password); + else + request->password = NULL; } @@ -646,7 +652,7 @@ g_return_val_if_fail (directory != NULL, GFTP_EFATAL); - if (request->sockfd <= 0 && !request->always_connected) + if (request->datafd <= 0 && !request->always_connected) { if (directory != request->directory) { @@ -1773,7 +1779,7 @@ return (GFTP_ERETRYABLE); } - request->sockfd = sock; + request->datafd = sock; if (request->post_connect != NULL) return (request->post_connect (request)); @@ -2141,12 +2147,10 @@ g_return_if_fail (source != NULL); g_return_if_fail (dest->protonum == source->protonum); - dest->sockfd = source->sockfd; dest->datafd = source->datafd; dest->cached = 0; if (!source->always_connected) { - source->sockfd = -1; source->datafd = -1; source->cached = 1; }