< prev index next >

src/java.base/unix/native/libnet/DefaultProxySelector.c

Print this page
rev 52699 : 8214014: Remove vestiges of gopher: protocol proxy support


  42  * These functions are used by the sun.net.spi.DefaultProxySelector class
  43  * to access some platform specific settings.
  44  * This is the Solaris/Linux Gnome 2.x code using the GConf-2 library.
  45  * Everything is loaded dynamically so no hard link with any library exists.
  46  * The GConf-2 settings used are:
  47  * - /system/http_proxy/use_http_proxy          boolean
  48  * - /system/http_proxy/use_authentcation       boolean
  49  * - /system/http_proxy/use_same_proxy          boolean
  50  * - /system/http_proxy/host                    string
  51  * - /system/http_proxy/authentication_user     string
  52  * - /system/http_proxy/authentication_password string
  53  * - /system/http_proxy/port                    int
  54  * - /system/proxy/socks_host                   string
  55  * - /system/proxy/mode                         string
  56  * - /system/proxy/ftp_host                     string
  57  * - /system/proxy/secure_host                  string
  58  * - /system/proxy/socks_port                   int
  59  * - /system/proxy/ftp_port                     int
  60  * - /system/proxy/secure_port                  int
  61  * - /system/proxy/no_proxy_for                 list
  62  * - /system/proxy/gopher_host                  string
  63  * - /system/proxy/gopher_port                  int
  64  *
  65  * The following keys are not used in the new gnome 3
  66  * - /system/http_proxy/use_http_proxy
  67  * - /system/http_proxy/use_same_proxy
  68  */
  69 typedef void* gconf_client_get_default_func();
  70 typedef char* gconf_client_get_string_func(void *, char *, void**);
  71 typedef int   gconf_client_get_int_func(void*, char *, void**);
  72 typedef int   gconf_client_get_bool_func(void*, char *, void**);
  73 typedef int   gconf_init_func(int, char**, void**);
  74 typedef void  g_type_init_func ();
  75 gconf_client_get_default_func* my_get_default_func = NULL;
  76 gconf_client_get_string_func* my_get_string_func = NULL;
  77 gconf_client_get_int_func* my_get_int_func = NULL;
  78 gconf_client_get_bool_func* my_get_bool_func = NULL;
  79 gconf_init_func* my_gconf_init_func = NULL;
  80 g_type_init_func* my_g_type_init_func = NULL;
  81 
  82 
  83 /*


 203              * HTTPS:
 204              * /system/proxy/mode (string) [ "manual" means use proxy settings ]
 205              * /system/proxy/secure_host (string)
 206              * /system/proxy/secure_port (integer)
 207              */
 208             if (strcasecmp(cproto, "https") == 0) {
 209                 phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL);
 210                 pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL);
 211                 use_proxy = (phost != NULL && pport != 0);
 212             }
 213 
 214             /**
 215              * FTP:
 216              * /system/proxy/mode (string) [ "manual" means use proxy settings ]
 217              * /system/proxy/ftp_host (string)
 218              * /system/proxy/ftp_port (integer)
 219              */
 220             if (strcasecmp(cproto, "ftp") == 0) {
 221                 phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL);
 222                 pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL);
 223                 use_proxy = (phost != NULL && pport != 0);
 224             }
 225 
 226             /**
 227              * GOPHER:
 228              * /system/proxy/mode (string) [ "manual" means use proxy settings ]
 229              * /system/proxy/gopher_host (string)
 230              * /system/proxy/gopher_port (integer)
 231              */
 232             if (strcasecmp(cproto, "gopher") == 0) {
 233                 phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL);
 234                 pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL);
 235                 use_proxy = (phost != NULL && pport != 0);
 236             }
 237 
 238             /**
 239              * SOCKS:
 240              * /system/proxy/mode (string) [ "manual" means use proxy settings ]
 241              * /system/proxy/socks_host (string)
 242              * /system/proxy/socks_port (integer)
 243              */
 244             if (strcasecmp(cproto, "socks") == 0) {
 245                 phost = (*my_get_string_func)(gconf_client, "/system/proxy/socks_host", NULL);
 246                 pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL);
 247                 use_proxy = (phost != NULL && pport != 0);
 248                 if (use_proxy)
 249                     ptype_ID = ptype_socksID;
 250             }
 251         }
 252     }
 253 
 254     if (use_proxy) {




  42  * These functions are used by the sun.net.spi.DefaultProxySelector class
  43  * to access some platform specific settings.
  44  * This is the Solaris/Linux Gnome 2.x code using the GConf-2 library.
  45  * Everything is loaded dynamically so no hard link with any library exists.
  46  * The GConf-2 settings used are:
  47  * - /system/http_proxy/use_http_proxy          boolean
  48  * - /system/http_proxy/use_authentcation       boolean
  49  * - /system/http_proxy/use_same_proxy          boolean
  50  * - /system/http_proxy/host                    string
  51  * - /system/http_proxy/authentication_user     string
  52  * - /system/http_proxy/authentication_password string
  53  * - /system/http_proxy/port                    int
  54  * - /system/proxy/socks_host                   string
  55  * - /system/proxy/mode                         string
  56  * - /system/proxy/ftp_host                     string
  57  * - /system/proxy/secure_host                  string
  58  * - /system/proxy/socks_port                   int
  59  * - /system/proxy/ftp_port                     int
  60  * - /system/proxy/secure_port                  int
  61  * - /system/proxy/no_proxy_for                 list


  62  *
  63  * The following keys are not used in the new gnome 3
  64  * - /system/http_proxy/use_http_proxy
  65  * - /system/http_proxy/use_same_proxy
  66  */
  67 typedef void* gconf_client_get_default_func();
  68 typedef char* gconf_client_get_string_func(void *, char *, void**);
  69 typedef int   gconf_client_get_int_func(void*, char *, void**);
  70 typedef int   gconf_client_get_bool_func(void*, char *, void**);
  71 typedef int   gconf_init_func(int, char**, void**);
  72 typedef void  g_type_init_func ();
  73 gconf_client_get_default_func* my_get_default_func = NULL;
  74 gconf_client_get_string_func* my_get_string_func = NULL;
  75 gconf_client_get_int_func* my_get_int_func = NULL;
  76 gconf_client_get_bool_func* my_get_bool_func = NULL;
  77 gconf_init_func* my_gconf_init_func = NULL;
  78 g_type_init_func* my_g_type_init_func = NULL;
  79 
  80 
  81 /*


 201              * HTTPS:
 202              * /system/proxy/mode (string) [ "manual" means use proxy settings ]
 203              * /system/proxy/secure_host (string)
 204              * /system/proxy/secure_port (integer)
 205              */
 206             if (strcasecmp(cproto, "https") == 0) {
 207                 phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL);
 208                 pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL);
 209                 use_proxy = (phost != NULL && pport != 0);
 210             }
 211 
 212             /**
 213              * FTP:
 214              * /system/proxy/mode (string) [ "manual" means use proxy settings ]
 215              * /system/proxy/ftp_host (string)
 216              * /system/proxy/ftp_port (integer)
 217              */
 218             if (strcasecmp(cproto, "ftp") == 0) {
 219                 phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL);
 220                 pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL);












 221                 use_proxy = (phost != NULL && pport != 0);
 222             }
 223 
 224             /**
 225              * SOCKS:
 226              * /system/proxy/mode (string) [ "manual" means use proxy settings ]
 227              * /system/proxy/socks_host (string)
 228              * /system/proxy/socks_port (integer)
 229              */
 230             if (strcasecmp(cproto, "socks") == 0) {
 231                 phost = (*my_get_string_func)(gconf_client, "/system/proxy/socks_host", NULL);
 232                 pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL);
 233                 use_proxy = (phost != NULL && pport != 0);
 234                 if (use_proxy)
 235                     ptype_ID = ptype_socksID;
 236             }
 237         }
 238     }
 239 
 240     if (use_proxy) {


< prev index next >