comparison lib/rfc959.c @ 227:a85a097bbb02

2003-7-20 Brian Masney <masneyb@gftp.org> * lib/config_file.c lib/gftp.h - added compare_function to gftp_config_vars structure. (gftp_set_global_option) use the compare function to see if the value was actually changed, and if so set the gftp_configuration_changed variable * lib/misc.c lib/gftp.h - For glib 1.2, added my version of g_build_path() since it's not there * lib/misc.c - GLIB/GTK+ 1.2 fixes * lib/protocols.c (gftp_fd_open) - cleaned up some * lib/rfc959.c (rfc959_init) - if the email address is blank, get the users address here instead of in register_module. It was being blanked out when the config file was being read * lib/options.h lib/rfc2068.c lib/rfc959.c lib/sshv2.c - mark the config variables that can show up in the bookmarks editor * src/text/gftp-text.c src/gtk/options_dialog.c - use gftp_set_global_option() to set the new configuration values * src/gtk/bookmarks.c - fixed crash in bookmarks dialog. Added notebook widget to the dialog as well. The options that can be edited for this site will show up in other tabs * src/gtk/gftp-gtk.c - fixes to the calls to gftp_set_global_option() * src/gtk/options_dialog.c - added gftp_gtk_setup_bookmark_options() to display all the editable options for this bookmark
author masneyb
date Mon, 21 Jul 2003 00:26:43 +0000
parents 0098dae654a5
children afbbc72b73e2
comparison
equal deleted inserted replaced
226:dbc7a0260d60 227:a85a097bbb02
33 {NULL, NULL} 33 {NULL, NULL}
34 }; 34 };
35 35
36 static gftp_config_vars config_vars[] = 36 static gftp_config_vars config_vars[] =
37 { 37 {
38 {"", N_("FTP"), gftp_option_type_notebook, NULL, NULL, 0, NULL, 38 {"", N_("FTP"), gftp_option_type_notebook, NULL, NULL,
39 GFTP_PORT_GTK, NULL}, 39 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL},
40 40
41 {"email", N_("Email address:"), 41 {"email", N_("Email address:"),
42 gftp_option_type_text, "", NULL, 0, 42 gftp_option_type_text, "", NULL, GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
43 N_("This is the password that will be used whenever you log into a remote FTP server as anonymous"), 43 N_("This is the password that will be used whenever you log into a remote FTP server as anonymous"),
44 GFTP_PORT_ALL, NULL}, 44 GFTP_PORT_ALL, NULL},
45 {"ftp_proxy_host", N_("Proxy hostname:"), 45 {"ftp_proxy_host", N_("Proxy hostname:"),
46 gftp_option_type_text, "", NULL, 0, 46 gftp_option_type_text, "", NULL, 0,
47 N_("Firewall hostname"), GFTP_PORT_ALL, NULL}, 47 N_("Firewall hostname"), GFTP_PORT_ALL, NULL},
63 /* xgettext:no-c-format */ 63 /* xgettext:no-c-format */
64 N_("This specifies how your proxy server expects us to log in. You can specify a 2 character replacement string prefixed by a % that will be replaced with the proper data. The first character can be either p for proxy or h for the host of the FTP server. The second character can be u (user), p (pass), h (host), o (port) or a (account). For example, to specify the proxy user, you can you type in %pu"), 64 N_("This specifies how your proxy server expects us to log in. You can specify a 2 character replacement string prefixed by a % that will be replaced with the proper data. The first character can be either p for proxy or h for the host of the FTP server. The second character can be u (user), p (pass), h (host), o (port) or a (account). For example, to specify the proxy user, you can you type in %pu"),
65 GFTP_PORT_ALL, NULL}, 65 GFTP_PORT_ALL, NULL},
66 66
67 {"passive_transfer", N_("Passive file transfers"), 67 {"passive_transfer", N_("Passive file transfers"),
68 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0, 68 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL,
69 GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
69 N_("If this is enabled, then the remote FTP server will open up a port for the data connection. If you are behind a firewall, you will need to enable this. Generally, it is a good idea to keep this enabled unless you are connecting to an older FTP server that doesn't support this. If this is disabled, then gFTP will open up a port on the client side and the remote server will attempt to connect to it."), 70 N_("If this is enabled, then the remote FTP server will open up a port for the data connection. If you are behind a firewall, you will need to enable this. Generally, it is a good idea to keep this enabled unless you are connecting to an older FTP server that doesn't support this. If this is disabled, then gFTP will open up a port on the client side and the remote server will attempt to connect to it."),
70 GFTP_PORT_ALL, NULL}, 71 GFTP_PORT_ALL, NULL},
71 {"resolve_symlinks", N_("Resolve Remote Symlinks (LIST -L)"), 72 {"resolve_symlinks", N_("Resolve Remote Symlinks (LIST -L)"),
72 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0, 73 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL,
74 GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
73 N_("The remote FTP server will attempt to resolve symlinks in the directory listings. Generally, this is a good idea to leave enabled. The only time you will want to disable this is if the remote FTP server doesn't support the -L option to LIST"), 75 N_("The remote FTP server will attempt to resolve symlinks in the directory listings. Generally, this is a good idea to leave enabled. The only time you will want to disable this is if the remote FTP server doesn't support the -L option to LIST"),
74 GFTP_PORT_ALL, NULL}, 76 GFTP_PORT_ALL, NULL},
75 {"ascii_transfers", N_("Transfer files in ASCII mode"), 77 {"ascii_transfers", N_("Transfer files in ASCII mode"),
76 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0, 78 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL,
79 GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
77 N_("If you are transfering a text file from Windows to UNIX box or vice versa, then you should enable this. Each system represents newlines differently for text files. If you are transfering from UNIX to UNIX, then it is safe to leave this off. If you are downloading binary data, you will want to disable this."), 80 N_("If you are transfering a text file from Windows to UNIX box or vice versa, then you should enable this. Each system represents newlines differently for text files. If you are transfering from UNIX to UNIX, then it is safe to leave this off. If you are downloading binary data, you will want to disable this."),
78 GFTP_PORT_ALL, NULL}, 81 GFTP_PORT_ALL, NULL},
79 82
80 {NULL, NULL, 0, NULL, NULL, 0, NULL, 0, NULL} 83 {NULL, NULL, 0, NULL, NULL, 0, NULL, 0, NULL}
81 }; 84 };
1628 1631
1629 1632
1630 void 1633 void
1631 rfc959_register_module (void) 1634 rfc959_register_module (void)
1632 { 1635 {
1636 gftp_register_config_vars (config_vars);
1637 }
1638
1639
1640 void
1641 rfc959_request_destroy (gftp_request * request)
1642 {
1643 rfc959_parms * parms;
1644
1645 parms = request->protocol_data;
1646
1647 if (parms->datafd_rbuf != NULL)
1648 gftp_free_getline_buffer (&parms->datafd_rbuf);
1649
1650 if (parms->dataconn_rbuf != NULL)
1651 gftp_free_getline_buffer (&parms->dataconn_rbuf);
1652 }
1653
1654
1655 int
1656 rfc959_init (gftp_request * request)
1657 {
1658 rfc959_parms * parms;
1633 struct hostent *hent; 1659 struct hostent *hent;
1634 struct utsname unme; 1660 struct utsname unme;
1635 struct passwd *pw; 1661 struct passwd *pw;
1636 char *tempstr; 1662 char *tempstr;
1637 1663
1638 gftp_register_config_vars (config_vars); 1664 g_return_val_if_fail (request != NULL, GFTP_EFATAL);
1639 1665
1640 gftp_lookup_global_option ("email", &tempstr); 1666 gftp_lookup_global_option ("email", &tempstr);
1641 if (tempstr == NULL || *tempstr == '\0') 1667 if (tempstr == NULL || *tempstr == '\0')
1642 { 1668 {
1643 /* If there is no email address specified, then we'll just use the 1669 /* If there is no email address specified, then we'll just use the
1648 if (strchr (unme.nodename, '.') == NULL && hent != NULL) 1674 if (strchr (unme.nodename, '.') == NULL && hent != NULL)
1649 tempstr = g_strconcat (pw->pw_name, "@", hent->h_name, NULL); 1675 tempstr = g_strconcat (pw->pw_name, "@", hent->h_name, NULL);
1650 else 1676 else
1651 tempstr = g_strconcat (pw->pw_name, "@", unme.nodename, NULL); 1677 tempstr = g_strconcat (pw->pw_name, "@", unme.nodename, NULL);
1652 gftp_set_global_option ("email", tempstr); 1678 gftp_set_global_option ("email", tempstr);
1653 } 1679 g_free (tempstr);
1654 } 1680 }
1655
1656
1657 void
1658 rfc959_request_destroy (gftp_request * request)
1659 {
1660 rfc959_parms * parms;
1661
1662 parms = request->protocol_data;
1663
1664 if (parms->datafd_rbuf != NULL)
1665 gftp_free_getline_buffer (&parms->datafd_rbuf);
1666
1667 if (parms->dataconn_rbuf != NULL)
1668 gftp_free_getline_buffer (&parms->dataconn_rbuf);
1669 }
1670
1671
1672 int
1673 rfc959_init (gftp_request * request)
1674 {
1675 rfc959_parms * parms;
1676
1677 g_return_val_if_fail (request != NULL, GFTP_EFATAL);
1678 1681
1679 request->protonum = GFTP_FTP_NUM; 1682 request->protonum = GFTP_FTP_NUM;
1680 request->init = rfc959_init; 1683 request->init = rfc959_init;
1681 request->destroy = rfc959_request_destroy; 1684 request->destroy = rfc959_request_destroy;
1682 request->read_function = gftp_fd_read; 1685 request->read_function = gftp_fd_read;