diff lib/rfc959.c @ 177:aec4b4541d3a

2003-6-9 Brian Masney <masneyb@gftp.org> * lib/bookmark.c lib/gftp.h lib/local.c lib/protocols.c lib/rfc2068.c lib/rfc959.c lib/sshv2.c - make return value of *_set_config_options() be an integer * lib/rfc2068.c lib/rfc959.c - return the error code of gftp_connect_server() if there was a connection problem
author masneyb
date Tue, 10 Jun 2003 12:03:54 +0000
parents 4c288d05b26a
children 33b394ebba68
line wrap: on
line diff
--- a/lib/rfc959.c	Mon Jun 09 23:16:53 2003 +0000
+++ b/lib/rfc959.c	Tue Jun 10 12:03:54 2003 +0000
@@ -436,8 +436,8 @@
   else if (strcasecmp (request->username, "anonymous") == 0)
     gftp_set_password (request, email);
    
-  if (gftp_connect_server (request, "ftp", proxy_hostname, proxy_port) < 0)
-    return (request->datafd);
+  if ((ret = gftp_connect_server (request, "ftp", proxy_hostname, proxy_port)) < 0)
+    return (ret);
 
   /* Get the banner */
   if ((ret = rfc959_read_response (request)) != '2')
@@ -1590,18 +1590,22 @@
 }
 
 
-static void
+static int
 rfc959_set_config_options (gftp_request * request)
 {
   char *proxy_config;
+  int ret;
 
   gftp_lookup_request_option (request, "proxy_config", &proxy_config);
   if (strcmp (proxy_config, "http") == 0)
     {
-      gftp_protocols[GFTP_HTTP_NUM].init (request); /* FIXME - check return value */
+      if ((ret = gftp_protocols[GFTP_HTTP_NUM].init (request)) < 0)
+        return (ret);
 
       gftp_set_request_option (request, "proxy_config", "ftp");
     }
+
+  return (0);
 }
 
 
@@ -1679,8 +1683,6 @@
   parms = request->protocol_data;
   parms->data_connection = -1; 
 
-  gftp_set_config_options (request);
-
-  return (0);
+  return (gftp_set_config_options (request));
 }