GNOME Bugzilla – Bug 643608
Connecting to FTP server & ftp server begins with ftp://
Last modified: 2011-05-23 15:22:46 UTC
Hi everybody, I wasn't a quite sure which product/component is the right, feel free to change it. How to reproduce the bug: 1, Select Places (system menu) -> Connect to server 2, Connection type: FTP (with login) 3, Put in Sever field: ftp://example.com 4, Fill username 5, Press connect Actual result: Waiting until a timeout and a error message. Expected result: Connecting to the server without problem.
Hmm, why is this a bug in GNOME? If the server is done or not accessible through your network, there's nothing that can be done.
The server is accessible (when I correctly enter address or use other FTP tool), but the utility is not able to handle the format. The problem is prefix ftp:// which cannot be handled correctly. I.e. example.com works perfect, ftp://example.com doesn't.
Created attachment 182688 [details] [review] preliminary patch It seems a fair request to me, and the fix looks trivial. The attached preliminary patch strips the scheme from the server URI _if_ it matches the chosen method's scheme. The problem is what to do if the method's scheme (e.g., ftp) doesn't match the server's scheme (e.g., ssh)... Comments are welcome.
I gave this a bit more thought. I think a nice solution would be: - when the combo box changes, the uri scheme of the server string (if any) is updated accordingly - when the uri scheme of the server string changes, the combo box is updated accordingly That requires a bit more code, but should be feasible. I'll wait for feedback from the maintainers and usability people before digging into it myself, though.
Review of attachment 182688 [details] [review]: Thanks for the patch. Except for this comment, looks good. ::: src/nautilus-connect-server-dialog.c @@ +530,3 @@ + temp = g_strconcat (meth->scheme, "://", NULL); + if (g_str_has_prefix (server, temp)) { + stripped_server = g_strdup (&server[strlen (meth->scheme) + 3]); Can't you just do stripped_server = g_strdup (server + strlen (temp)); ?
(In reply to comment #3) > The problem is what to do if the method's scheme (e.g., > ftp) doesn't match the server's scheme (e.g., ssh)... Comments are welcome. I think it's just fine to error out in that case, so feel free to remove the FIXME too.
I pushed this now to master and gnome-3-0 for 3.0.2, with the fix I suggested here.