comparison lib/ftps.c @ 847:14858879916f

2006-11-2 Brian Masney <masneyb@gftp.org> * lib/ftpcommon.h lib/ftps.c lib/rfc959.c - use the encoded filename length to determine how many bytes should be sent in the command to the remote server. Don't use the strlen() function since there may be a NUL character in the filename. ATTENTION INTERNATIONAL USERS: If you have time, can you test the filename encoding in CVS? All of the necessary changes were made to the local, FTP and SSH protocols. Let me know if you see any problems.
author masneyb
date Fri, 03 Nov 2006 03:23:19 +0000
parents 435b11d2d628
children 1808cebed602
comparison
equal deleted inserted replaced
846:77660334b282 847:14858879916f
58 rfc959_parms * params; 58 rfc959_parms * params;
59 int ret; 59 int ret;
60 60
61 params = request->protocol_data; 61 params = request->protocol_data;
62 62
63 ret = rfc959_send_command (request, "AUTH TLS\r\n", 1, 0); 63 ret = rfc959_send_command (request, "AUTH TLS\r\n", -1, 1, 0);
64 if (ret < 0) 64 if (ret < 0)
65 return (ret); 65 return (ret);
66 else if (ret != '2') 66 else if (ret != '2')
67 return (GFTP_EFATAL); 67 return (GFTP_EFATAL);
68 68
70 return (ret); 70 return (ret);
71 71
72 request->read_function = gftp_ssl_read; 72 request->read_function = gftp_ssl_read;
73 request->write_function = gftp_ssl_write; 73 request->write_function = gftp_ssl_write;
74 74
75 ret = rfc959_send_command (request, "PBSZ 0\r\n", 1, 0); 75 ret = rfc959_send_command (request, "PBSZ 0\r\n", -1, 1, 0);
76 if (ret < 0) 76 if (ret < 0)
77 return (ret); 77 return (ret);
78 78
79 ret = '5'; /* FIXME */ 79 ret = '5'; /* FIXME */
80 /* ret = rfc959_send_command (request, "PROT P\r\n", 1, 0); */ 80 /* ret = rfc959_send_command (request, "PROT P\r\n", -1, 1, 0); */
81 if (ret < 0) 81 if (ret < 0)
82 return (ret); 82 return (ret);
83 else if (ret == '2') 83 else if (ret == '2')
84 { 84 {
85 params->data_conn_read = gftp_ssl_read; 85 params->data_conn_read = gftp_ssl_read;
86 params->data_conn_write = gftp_ssl_write; 86 params->data_conn_write = gftp_ssl_write;
87 } 87 }
88 else 88 else
89 { 89 {
90 ret = rfc959_send_command (request, "PROT C\r\n", 1, 0); 90 ret = rfc959_send_command (request, "PROT C\r\n", -1, 1, 0);
91 if (ret < 0) 91 if (ret < 0)
92 return (ret); 92 return (ret);
93 else if (ret != '2') 93 else if (ret != '2')
94 { 94 {
95 gftp_disconnect (request); 95 gftp_disconnect (request);