changeset 66:cd3e457cbc85

2002-11-26 Brian Masney <masneyb@gftp.org> * configure.in - change version to 2.0.14rc1 * lib/local.c - fix for uploading files. Move setting of hostname from local_connect() to local_init() * lib/misc.c (gftp_request) - copy only select fields over instead of whole structure * lib/protocols.c (gftp_request_new) - set datafd and cachefd to -1 * lib/protocols.c (gftp_set_proxy_config) - allow a NULL proxy_config to be passed * src/gtk/misc-gtk.c (update_window) - don't show the hostname if we are connected via the local protocol * src/gtk/transfer.c (create_transfer) - check to see if this protocol is always connected
author masneyb
date Wed, 27 Nov 2002 02:23:51 +0000
parents 4b5fec7711e9
children aa971a4bb16f
files ChangeLog Makefile.am TODO configure.in lib/local.c lib/misc.c lib/protocols.c src/gtk/misc-gtk.c src/gtk/transfer.c
diffstat 9 files changed, 62 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Nov 26 14:58:13 2002 +0000
+++ b/ChangeLog	Wed Nov 27 02:23:51 2002 +0000
@@ -1,3 +1,23 @@
+2002-11-26 Brian Masney <masneyb@gftp.org>
+	* configure.in - change version to 2.0.14rc1
+
+	* lib/local.c - fix for uploading files. Move setting of hostname
+	from local_connect() to local_init()
+
+	* lib/misc.c (gftp_request) - copy only select fields over instead of
+	whole structure
+
+	* lib/protocols.c (gftp_request_new) - set datafd and cachefd to -1
+
+	* lib/protocols.c (gftp_set_proxy_config) - allow a NULL proxy_config
+	to be passed
+
+	* src/gtk/misc-gtk.c (update_window) - don't show the hostname if we
+	are connected via the local protocol
+
+	* src/gtk/transfer.c (create_transfer) - check to see if this protocol
+	is always connected
+
 2002-11-25 Brian Masney <masneyb@gftp.org>
 	* lib/misc.c (ssh_start_login_sequence) - fixes for when the initial
 	SSH banner is bigger than 200 characters
@@ -307,7 +327,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.40 2002/11/26 14:58:10 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.41 2002/11/27 02:23:50 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/Makefile.am	Tue Nov 26 14:58:13 2002 +0000
+++ b/Makefile.am	Wed Nov 27 02:23:51 2002 +0000
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS=docs lib po src
-EXTRA_DIST=ChangeLog-old README THANKS TODO \
+SUBDIRS= intl docs lib po src
+EXTRA_DIST= config.rpath mkinstalldirs ChangeLog-old README THANKS TODO \
 	gftp.spec.in debian/changelog debian/control debian/copyright \
 	debian/dirs debian/docs debian/menu debian/rules
 
--- a/TODO	Tue Nov 26 14:58:13 2002 +0000
+++ b/TODO	Wed Nov 27 02:23:51 2002 +0000
@@ -2,6 +2,7 @@
 of gFTP. If there is something you feel should be included in a future
 version of gFTP, please email me about it.
 
+* Add option to hide certain files
 * Be able to save the state of the transfer queue. Be able to pause transfers.
   Be able to edit the transfer information (hostname, user, etc)
 * For bookmarks, be able to specify a local protocol, host, port, directory
--- a/configure.in	Tue Nov 26 14:58:13 2002 +0000
+++ b/configure.in	Wed Nov 27 02:23:51 2002 +0000
@@ -3,7 +3,7 @@
 AC_INIT(lib/gftp.h)
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(gftp,2.0.14)
+AM_INIT_AUTOMAKE(gftp,2.0.14rc1)
 
 AC_ARG_ENABLE(gtk20, [  --disable-gtk20	  Don't look for GTK+ 2.0 libraries], enable_gtk20=0, enable_gtk20=1)
 AC_ARG_ENABLE(gtkport, [  --disable-gtkport	  Disable compiling the GTK+ port], enable_gtkport=0, enable_gtkport=1)
@@ -247,4 +247,4 @@
 
 AM_GNU_GETTEXT
 
-AC_OUTPUT(Makefile docs/Makefile docs/sample.gftp/Makefile src/gftp src/Makefile src/gtk/Makefile src/text/Makefile lib/Makefile gftp.spec)
+AC_OUTPUT(Makefile docs/Makefile docs/sample.gftp/Makefile src/gftp src/Makefile src/gtk/Makefile src/text/Makefile lib/Makefile gftp.spec intl/Makefile po/Makefile.in )
--- a/lib/local.c	Tue Nov 26 14:58:13 2002 +0000
+++ b/lib/local.c	Wed Nov 27 02:23:51 2002 +0000
@@ -59,9 +59,6 @@
   g_return_val_if_fail (request != NULL, -2);
   g_return_val_if_fail (request->protonum == GFTP_LOCAL_NUM, -2);
 
-  if (request->hostname == NULL)
-    request->hostname = g_strdup (_("local filesystem"));
-
   if (request->directory)
     {
       if (chdir (request->directory) != 0)
@@ -117,7 +114,7 @@
   g_return_val_if_fail (request->protonum == GFTP_LOCAL_NUM, -2);
   g_return_val_if_fail (filename != NULL, -2);
 
-  if (fd > 0)
+  if (fd <= 0)
     {
       flags = O_RDONLY;
 #if defined (_LARGEFILE_SOURCE)
@@ -167,7 +164,7 @@
   g_return_val_if_fail (request->protonum == GFTP_LOCAL_NUM, -2);
   g_return_val_if_fail (filename != NULL, -2);
 
-  if (fd < 0)
+  if (fd <= 0)
     {
       flags = O_WRONLY | O_CREAT;
       if (startsize > 0)
@@ -701,5 +698,9 @@
   request->protocol_data = lpd;
   lpd->userhash = g_hash_table_new (hash_function, hash_compare);
   lpd->grouphash = g_hash_table_new (hash_function, hash_compare);
+
+  if (request->hostname != NULL)
+    g_free (request->hostname);
+  request->hostname = g_strdup (_("local filesystem"));
 }
 
--- a/lib/misc.c	Tue Nov 26 14:58:13 2002 +0000
+++ b/lib/misc.c	Wed Nov 27 02:23:51 2002 +0000
@@ -569,8 +569,7 @@
 {
   gftp_request * newreq;
 
-  newreq = g_malloc0 (sizeof (*newreq));
-  memcpy (newreq, req, sizeof (*newreq));
+  newreq = gftp_request_new ();
 
   if (req->hostname)
     newreq->hostname = g_strdup (req->hostname);
@@ -582,24 +581,20 @@
     newreq->account = g_strdup (req->account);
   if (req->directory)
     newreq->directory = g_strdup (req->directory);
+  newreq->port = req->port;
+  newreq->data_type = req->data_type;
+  newreq->use_proxy = req->use_proxy;
+  gftp_set_proxy_config (newreq, req->proxy_config);
+  newreq->transfer_type = req->transfer_type;
+  newreq->network_timeout = req->network_timeout;
+  newreq->retries = req->retries;
+  newreq->sleep_time = req->sleep_time;
+  newreq->passive_transfer = req->passive_transfer;
+  newreq->maxkbs = req->maxkbs;
+  newreq->logging_function = req->logging_function;
 
-  newreq->url_prefix = NULL;
-  newreq->protocol_name = NULL;
-  newreq->sftpserv_path = NULL;
-  newreq->proxy_config = NULL;
-  newreq->proxy_hostname = NULL;
-  newreq->proxy_username = NULL;
-  newreq->proxy_password = NULL;
-  newreq->proxy_account = NULL;
-  newreq->last_ftp_response = NULL;
-  newreq->last_dir_entry = NULL;
-  newreq->sockfd = -1;
-  newreq->datafd = -1;
-  newreq->cachefd = -1;
-  newreq->hostp = NULL;
-  
-  if (req->proxy_config != NULL)
-    newreq->proxy_config = g_strdup (req->proxy_config);
+  if (req->sftpserv_path != NULL)
+    newreq->sftpserv_path = g_strdup (req->sftpserv_path);
 
   req->init (newreq);
 
--- a/lib/protocols.c	Tue Nov 26 14:58:13 2002 +0000
+++ b/lib/protocols.c	Wed Nov 27 02:23:51 2002 +0000
@@ -27,6 +27,8 @@
 
   request = g_malloc0 (sizeof (*request));
   request->sockfd = -1;
+  request->datafd = -1;
+  request->cachefd = -1;
   request->data_type = GFTP_TYPE_BINARY;
   return (request);
 }
@@ -714,11 +716,16 @@
   int len;
 
   g_return_if_fail (request != NULL);
-  g_return_if_fail (proxy_config != NULL);
 
   if (request->proxy_config != NULL)
     g_free (request->proxy_config);
 
+  if (proxy_config == NULL)
+    {
+      request->proxy_config = NULL;
+      return;
+    }
+
   len = strlen (proxy_config);
 
   if (len > 0 && (proxy_config[len - 1] != 'n' ||
@@ -1668,7 +1675,7 @@
                                      _("Failed to create a socket: %s\n"),
                                      g_strerror (errno));
           continue; 
-        }
+        } 
 
       request->logging_function (gftp_logging_misc, request->user_data,
 				 _("Trying %s:%d\n"), disphost, port);
--- a/src/gtk/misc-gtk.c	Tue Nov 26 14:58:13 2002 +0000
+++ b/src/gtk/misc-gtk.c	Wed Nov 27 02:23:51 2002 +0000
@@ -298,7 +298,8 @@
     {
       fspec = wdata->show_selected ? "Selected" : strcmp (wdata->filespec, "*") == 0 ?  _("All Files") : wdata->filespec;
 
-      if ((temp1str = GFTP_GET_HOSTNAME (wdata->request)) == NULL)
+      if ((temp1str = GFTP_GET_HOSTNAME (wdata->request)) == NULL ||
+          wdata->request->protonum == GFTP_LOCAL_NUM)
 	temp1str = "";
       tempstr = g_strconcat (temp1str, *temp1str == '\0' ? "[" : " [",
 		     GFTP_GET_PROTOCOL_NAME (wdata->request),
@@ -687,6 +688,7 @@
 check_reconnect (gftp_window_data *wdata)
 {
   return (wdata->request->cached && wdata->request->sockfd < 0 && 
+          !wdata->request->always_connected &&
 	  !ftp_connect (wdata, wdata->request, 0) ? -1 : 0);
 }
 
--- a/src/gtk/transfer.c	Tue Nov 26 14:58:13 2002 +0000
+++ b/src/gtk/transfer.c	Wed Nov 27 02:23:51 2002 +0000
@@ -1405,8 +1405,8 @@
     {
       fromreq = tdata->fromwdata != NULL ? ((gftp_window_data *) tdata->fromwdata)->request : NULL;
       if (!tdata->fromreq->stopable && tdata->fromwdata &&
-          ((fromreq->sockfd < 0 && fromreq->cached) ||
-           fromreq->always_connected) && tdata->fromreq->sockfd > 0 &&
+          fromreq->sockfd < 0 && fromreq->cached &&
+          (tdata->fromreq->sockfd > 0 || tdata->fromreq->always_connected) &&
           compare_request (tdata->fromreq, fromreq, 0))
 	{
           gftp_swap_socks (((gftp_window_data *) tdata->towdata)->request, 
@@ -1460,7 +1460,8 @@
   if (!tdata->fromreq->stopable)
     {
       if (tdata->fromwdata && 
-          ((gftp_window_data *) tdata->fromwdata)->request->sockfd > 0 && 
+          (((gftp_window_data *) tdata->fromwdata)->request->sockfd > 0 ||
+           ((gftp_window_data *) tdata->fromwdata)->request->always_connected) && 
           !((gftp_window_data *) tdata->fromwdata)->request->stopable &&
           compare_request (tdata->fromreq, ((gftp_window_data *) tdata->fromwdata)->request, 0))
 	{