89 |
read_proxy (HWND dlg, keyserver_proxy_t ctx) |
read_proxy (HWND dlg, keyserver_proxy_t ctx) |
90 |
{ |
{ |
91 |
char t[512]; |
char t[512]; |
92 |
int ncount = 0, pos = 0; |
int ncount; |
93 |
|
|
94 |
ncount = GetDlgItemText (dlg, IDC_PROXY_PWD, t, DIM (t)-1); |
ncount = GetDlgItemText (dlg, IDC_PROXY_PWD, t, DIM (t)-1); |
95 |
if (ncount > 0) |
if (ncount > 0) |
96 |
ctx->pass = m_strdup (t); |
ctx->pass = m_strdup (t); |
99 |
ctx->user = m_strdup (t); |
ctx->user = m_strdup (t); |
100 |
ncount = GetDlgItemText (dlg, IDC_PROXY_HOST, t, DIM (t)-1); |
ncount = GetDlgItemText (dlg, IDC_PROXY_HOST, t, DIM (t)-1); |
101 |
if (ncount > 0) { |
if (ncount > 0) { |
102 |
if (check_IP_or_hostname (t)) { |
int pos = 0; |
103 |
msg_box (dlg, _("Invalid host/IP address."), _("Proxy Settings"), MB_ERR); |
|
104 |
|
if (check_inet_address (t)) { |
105 |
|
msg_box (dlg, _("Invalid host or IP address."), _("Proxy Settings"), MB_ERR); |
106 |
return -1; |
return -1; |
107 |
} |
} |
108 |
/* XXX: check prefix */ |
/* XXX: check prefix */ |
148 |
enable_proxy_auth (HWND dlg, int val) |
enable_proxy_auth (HWND dlg, int val) |
149 |
{ |
{ |
150 |
int mode = val? TRUE : FALSE; |
int mode = val? TRUE : FALSE; |
151 |
|
|
152 |
EnableWindow (GetDlgItem (dlg, IDC_PROXY_PWD), mode); |
EnableWindow (GetDlgItem (dlg, IDC_PROXY_PWD), mode); |
153 |
EnableWindow (GetDlgItem (dlg, IDC_PROXY_USER), mode); |
EnableWindow (GetDlgItem (dlg, IDC_PROXY_USER), mode); |
154 |
} |
} |
159 |
init_proxy_protocols (HWND dlg) |
init_proxy_protocols (HWND dlg) |
160 |
{ |
{ |
161 |
HWND cb = GetDlgItem (dlg, IDC_PROXY_PROTO); |
HWND cb = GetDlgItem (dlg, IDC_PROXY_PROTO); |
162 |
|
|
163 |
combox_add_string (cb, (char *)"NONE"); |
combox_add_string (cb, (char *)"NONE"); |
164 |
combox_add_string (cb, (char *)"HTTP"); |
combox_add_string (cb, (char *)"HTTP"); |
165 |
/*XXX: combox_add_string (cb, (char *)"SOCKS5");*/ |
/*XXX: combox_add_string (cb, (char *)"SOCKS5");*/ |