diff lib/ftps.c @ 390:0444232dc494

2003-2-3 Brian Masney <masneyb@gftp.org> * lib/ftpcommon.h lib/ftps.c lib/rfc959.c - added pointers to read/write functions to the rfc959_params structure for the data connection. For now, this is always set to the plaintext version.
author masneyb
date Wed, 04 Feb 2004 02:20:33 +0000
parents b39a312323ec
children 14ef37b62c20
line wrap: on
line diff
--- a/lib/ftps.c	Wed Feb 04 01:53:06 2004 +0000
+++ b/lib/ftps.c	Wed Feb 04 02:20:33 2004 +0000
@@ -55,9 +55,26 @@
   if (ret < 0)
     return (ret);
 
-  ret = rfc959_send_command (request, "PROT C\r\n", 1);
+  ret = '5'; /* FIXME */
+  /* ret = rfc959_send_command (request, "PROT P\r\n", 1); */
   if (ret < 0)
     return (ret);
+  else if (ret == '2')
+    {
+      params->data_conn_read = gftp_ssl_read;
+      params->data_conn_write = gftp_ssl_write;
+      params->encrypted_connection = 1;
+    }
+  else
+    {
+      ret = rfc959_send_command (request, "PROT C\r\n", 1);
+      if (ret < 0)
+        return (ret);
+
+      params->data_conn_read = gftp_fd_read;
+      params->data_conn_write = gftp_fd_write;
+      params->encrypted_connection = 0;
+    }
 
   return (0);
 }