libpurple/proxy.c

changeset 37965
b67fb3fb5f85
parent 37964
39fca28f1a6e
child 38323
568872933468
equal deleted inserted replaced
37964:39fca28f1a6e 37965:b67fb3fb5f85
1025 purple_proxy_connect_cancel(connect_data); 1025 purple_proxy_connect_cancel(connect_data);
1026 } 1026 }
1027 } 1027 }
1028 1028
1029 GProxyResolver * 1029 GProxyResolver *
1030 purple_proxy_get_proxy_resolver(PurpleAccount *account) 1030 purple_proxy_get_proxy_resolver(PurpleAccount *account, GError **error)
1031 { 1031 {
1032 PurpleProxyInfo *info = purple_proxy_get_setup(account); 1032 PurpleProxyInfo *info = purple_proxy_get_setup(account);
1033 const gchar *protocol; 1033 const gchar *protocol;
1034 const gchar *username; 1034 const gchar *username;
1035 const gchar *password; 1035 const gchar *password;
1060 case PURPLE_PROXY_TOR: 1060 case PURPLE_PROXY_TOR:
1061 protocol = "socks5"; 1061 protocol = "socks5";
1062 break; 1062 break;
1063 1063
1064 default: 1064 default:
1065 purple_debug_error("proxy", 1065 g_set_error(error, PURPLE_CONNECTION_ERROR,
1066 "Invalid Proxy type (%d) specified.\n", 1066 PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
1067 _("Invalid Proxy type (%d) specified"),
1067 purple_proxy_info_get_proxy_type(info)); 1068 purple_proxy_info_get_proxy_type(info));
1068 return NULL; 1069 return NULL;
1069 } 1070 }
1070 1071
1071 1072
1072 if (purple_proxy_info_get_host(info) == NULL || 1073 if (purple_proxy_info_get_host(info) == NULL ||
1073 purple_proxy_info_get_port(info) <= 0) { 1074 purple_proxy_info_get_port(info) <= 0) {
1074 purple_notify_error(NULL, NULL, 1075 g_set_error_literal(error, PURPLE_CONNECTION_ERROR,
1075 _("Invalid proxy settings"), 1076 PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
1076 _("Either the host name or port number " 1077 _("Either the host name or port number "
1077 "specified for your given proxy type is " 1078 "specified for your given proxy type is "
1078 "invalid."), 1079 "invalid."));
1079 purple_request_cpar_from_account( account));
1080 return NULL; 1080 return NULL;
1081 } 1081 }
1082 1082
1083 /* Everything checks out. Create and return the GProxyResolver */ 1083 /* Everything checks out. Create and return the GProxyResolver */
1084 1084

mercurial