comparison lib/rfc959.c @ 643:117bcf24add2

2004-12-12 Brian Masney <masneyb@gftp.org> * lib/rfc959.c - renamed pasv_behind_router option to ignore_pasv_address. This is a better explanation of what it does
author masneyb
date Sun, 12 Dec 2004 12:09:56 +0000
parents b9e8b22bf3b1
children c197c8fb1e62
comparison
equal deleted inserted replaced
642:b9e8b22bf3b1 643:117bcf24add2
64 gftp_option_type_textcomboedt, "", gftp_proxy_type, 0, 64 gftp_option_type_textcomboedt, "", gftp_proxy_type, 0,
65 /* xgettext:no-c-format */ 65 /* xgettext:no-c-format */
66 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"), 66 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"),
67 GFTP_PORT_ALL, NULL}, 67 GFTP_PORT_ALL, NULL},
68 68
69 {"ignore_pasv_address", N_("Ignore PASV address"),
70 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL,
71 GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
72 N_("If this is enabled, then the remote FTP server's PASV IP address field will be ignored and the host's IP address will be used instead. This is often needed for routers giving their internal rather then their external IP address in a PASV reply."),
73 GFTP_PORT_ALL, NULL},
69 {"passive_transfer", N_("Passive file transfers"), 74 {"passive_transfer", N_("Passive file transfers"),
70 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 75 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL,
71 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, 76 GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
72 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."), 77 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."),
73 GFTP_PORT_ALL, NULL},
74 {"pasv_behind_router", N_("PASV Host Behind Router"),
75 gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL,
76 GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
77 N_("If this is enabled, then the remote FTP server's PASV IP address field will be ignored and the host's IP address will be used instead. This is often needed for routers giving their internal rather then their external IP address in a PASV reply."),
78 GFTP_PORT_ALL, NULL}, 78 GFTP_PORT_ALL, NULL},
79 {"resolve_symlinks", N_("Resolve Remote Symlinks (LIST -L)"), 79 {"resolve_symlinks", N_("Resolve Remote Symlinks (LIST -L)"),
80 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 80 gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL,
81 GFTP_CVARS_FLAGS_SHOW_BOOKMARK, 81 GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
82 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"), 82 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"),
626 626
627 static int 627 static int
628 rfc959_ipv4_data_connection_new (gftp_request * request) 628 rfc959_ipv4_data_connection_new (gftp_request * request)
629 { 629 {
630 struct sockaddr_in data_addr; 630 struct sockaddr_in data_addr;
631 intptr_t pasv_behind_router; 631 intptr_t ignore_pasv_address;
632 char *pos, *pos1, *command; 632 char *pos, *pos1, *command;
633 intptr_t passive_transfer; 633 intptr_t passive_transfer;
634 rfc959_parms * parms; 634 rfc959_parms * parms;
635 socklen_t data_addr_len; 635 socklen_t data_addr_len;
636 unsigned int temp[6]; 636 unsigned int temp[6];
700 for (i = 0; i < 6; i++) 700 for (i = 0; i < 6; i++)
701 ad[i] = (unsigned char) (temp[i] & 0xff); 701 ad[i] = (unsigned char) (temp[i] & 0xff);
702 702
703 memcpy (&data_addr.sin_port, &ad[4], 2); 703 memcpy (&data_addr.sin_port, &ad[4], 2);
704 704
705 gftp_lookup_request_option (request, "pasv_behind_router", 705 gftp_lookup_request_option (request, "ignore_pasv_address",
706 &pasv_behind_router); 706 &ignore_pasv_address);
707 if (pasv_behind_router) 707 if (ignore_pasv_address)
708 { 708 {
709 #if defined (HAVE_GETADDRINFO) 709 #if defined (HAVE_GETADDRINFO)
710 memcpy (&data_addr.sin_addr, 710 memcpy (&data_addr.sin_addr,
711 &((struct sockaddr_in *) request->current_hostp->ai_addr)->sin_addr, 711 &((struct sockaddr_in *) request->current_hostp->ai_addr)->sin_addr,
712 sizeof (data_addr.sin_addr)); 712 sizeof (data_addr.sin_addr));