diff lib/protocols.c @ 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
line wrap: on
line diff
--- 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);