changeset 298:6e0b9ca541e2

2003-10-26 Brian Masney <masneyb@gftp.org> * lib/rfc959.c - convert the PASS command from UTF8 using gftp_convert_from_utf8()
author masneyb
date Mon, 27 Oct 2003 01:40:08 +0000
parents 6d088dfece0b
children 6da95954fe41
files ChangeLog lib/rfc959.c
diffstat 2 files changed, 29 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 27 01:22:45 2003 +0000
+++ b/ChangeLog	Mon Oct 27 01:40:08 2003 +0000
@@ -1,4 +1,7 @@
 2003-10-26 Brian Masney <masneyb@gftp.org>
+	* lib/rfc959.c - convert the PASS command from UTF8 using 
+	gftp_convert_from_utf8()
+
 	* src/gtk/gftp-gtk.h src/gtk/transfer.c - (create_transfer, 
 	transfer_done) - added more checks whenever a transfer is created and
 	stopped to make sure we don't log into the same remote host twice. This
@@ -1631,7 +1634,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.159 2003/10/27 01:22:45 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.160 2003/10/27 01:40:06 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/rfc959.c	Mon Oct 27 01:22:45 2003 +0000
+++ b/lib/rfc959.c	Mon Oct 27 01:40:08 2003 +0000
@@ -186,7 +186,7 @@
 static char *
 parse_ftp_proxy_string (gftp_request * request)
 {
-  char *startpos, *endpos, *newstr, *newval, tempport[6], *proxy_config,
+  char *startpos, *endpos, *newstr, *newval, tempport[6], *proxy_config, *utf8,
        savechar;
   size_t len;
   int tmp;
@@ -283,10 +283,22 @@
         }
       else
         {
-          len += strlen (newval);
+          utf8 = gftp_string_from_utf8 (request, newval);
+          if (utf8 != NULL)
+            len += strlen (utf8);
+          else
+            len += strlen (newval);
+
           newstr = g_realloc (newstr, sizeof (char) * (len + 1));
           strcat (newstr, startpos);
-          strcat (newstr, newval);
+
+          if (utf8 != NULL)
+            {
+              strcat (newstr, utf8);
+              g_free (utf8);
+            }
+          else
+            strcat (newstr, newval);
         }
    
       *endpos = savechar;
@@ -420,7 +432,7 @@
 static int
 rfc959_connect (gftp_request * request)
 {
-  char tempchar, *startpos, *endpos, *tempstr, *email, *proxy_hostname;
+  char tempchar, *startpos, *endpos, *tempstr, *email, *proxy_hostname, *utf8;
   int ret, resp, ascii_transfers, proxy_port;
   rfc959_parms * parms;
 
@@ -489,7 +501,15 @@
 
       if (resp == '3')
 	{
-	  tempstr = g_strconcat ("PASS ", request->password, "\r\n", NULL);
+          utf8 = gftp_string_from_utf8 (request, request->password);
+          if (utf8 != NULL)
+            {
+              tempstr = g_strconcat ("PASS ", utf8, "\r\n", NULL);
+              g_free (utf8);
+            }
+          else
+            tempstr = g_strconcat ("PASS ", request->password, "\r\n", NULL);
+
 	  resp = rfc959_send_command (request, tempstr, 1);
 	  g_free (tempstr);
           if (resp < 0)