зеркало из https://github.com/mozilla/gecko-dev.git
Bug 242884 Proxy config should require hostIP:port and/or error
patch by ajschult@verizon.net r=dveditz sr=bryner
This commit is contained in:
Родитель
3995c366d7
Коммит
531b1fd6d6
|
@ -82,7 +82,8 @@
|
|||
E_NO_DISK_SPACE = -627, /* not eough disk space to install */
|
||||
E_CRC_FAILED = -628, /* CRC failed */
|
||||
E_USAGE_SHOWN = -629, /* showed the usage message */
|
||||
E_DIR_NOT_EMPTY = -630 /* destination dir wasn't empty */
|
||||
E_DIR_NOT_EMPTY = -630, /* destination dir wasn't empty */
|
||||
E_INVALID_PROXY = -631 /* invalid proxy settings */
|
||||
};
|
||||
|
||||
#endif /* _XI_ERRORS_H_ */
|
||||
|
|
|
@ -1044,52 +1044,41 @@ nsInstallDlg::PSDlgOK(GtkWidget *aWidget, gpointer aData)
|
|||
GtkWidget *dlg = (GtkWidget *) aData;
|
||||
char *text;
|
||||
|
||||
XI_IF_FREE(gCtx->opt->mProxyHost);
|
||||
XI_IF_FREE(gCtx->opt->mProxyPort);
|
||||
XI_IF_FREE(gCtx->opt->mProxyUser);
|
||||
XI_IF_FREE(gCtx->opt->mProxyPswd);
|
||||
|
||||
// grab proxy host field
|
||||
if (sPSTextEntry[0])
|
||||
{
|
||||
text = gtk_editable_get_chars(GTK_EDITABLE(sPSTextEntry[0]), 0, -1);
|
||||
if (text)
|
||||
{
|
||||
XI_IF_FREE(gCtx->opt->mProxyHost);
|
||||
gCtx->opt->mProxyHost = text;
|
||||
}
|
||||
}
|
||||
text = gtk_editable_get_chars(GTK_EDITABLE(sPSTextEntry[0]), 0, -1);
|
||||
if (text && *text)
|
||||
gCtx->opt->mProxyHost = text;
|
||||
|
||||
// grab proxy port field
|
||||
if (sPSTextEntry[1])
|
||||
{
|
||||
text = gtk_editable_get_chars(GTK_EDITABLE(sPSTextEntry[1]), 0, -1);
|
||||
if (text)
|
||||
{
|
||||
XI_IF_FREE(gCtx->opt->mProxyPort);
|
||||
gCtx->opt->mProxyPort = text;
|
||||
}
|
||||
}
|
||||
text = gtk_editable_get_chars(GTK_EDITABLE(sPSTextEntry[1]), 0, -1);
|
||||
if (text && *text)
|
||||
gCtx->opt->mProxyPort = text;
|
||||
|
||||
// grab proxy user field
|
||||
if (sPSTextEntry[2])
|
||||
{
|
||||
text = gtk_editable_get_chars(GTK_EDITABLE(sPSTextEntry[2]), 0, -1);
|
||||
if (text)
|
||||
{
|
||||
XI_IF_FREE(gCtx->opt->mProxyUser);
|
||||
gCtx->opt->mProxyUser = text;
|
||||
}
|
||||
}
|
||||
text = gtk_editable_get_chars(GTK_EDITABLE(sPSTextEntry[2]), 0, -1);
|
||||
if (text && *text)
|
||||
gCtx->opt->mProxyUser = text;
|
||||
|
||||
// grab proxy pswd field
|
||||
if (sPSTextEntry[3])
|
||||
{
|
||||
text = gtk_editable_get_chars(GTK_EDITABLE(sPSTextEntry[3]), 0, -1);
|
||||
if (text)
|
||||
{
|
||||
XI_IF_FREE(gCtx->opt->mProxyPswd);
|
||||
gCtx->opt->mProxyPswd = text;
|
||||
}
|
||||
}
|
||||
text = gtk_editable_get_chars(GTK_EDITABLE(sPSTextEntry[3]), 0, -1);
|
||||
if (text && *text)
|
||||
gCtx->opt->mProxyPswd = text;
|
||||
|
||||
if (dlg)
|
||||
if ( (gCtx->opt->mProxyHost || gCtx->opt->mProxyPort ||
|
||||
gCtx->opt->mProxyUser || gCtx->opt->mProxyPswd)
|
||||
&& (!gCtx->opt->mProxyHost || !gCtx->opt->mProxyPort) )
|
||||
{
|
||||
ErrorHandler(E_INVALID_PROXY);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy(dlg);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -92,7 +92,7 @@ nsXIContext::~nsXIContext()
|
|||
|
||||
#define MAX_KEY_SIZE 64
|
||||
#define FIRST_ERR -601
|
||||
#define LAST_ERR -630
|
||||
#define LAST_ERR -631
|
||||
int
|
||||
nsXIContext::LoadResources()
|
||||
{
|
||||
|
|
|
@ -497,6 +497,7 @@ IsErrFatal(int aErr)
|
|||
case E_MKDIR_FAIL:
|
||||
case E_OLD_INST:
|
||||
case E_DIR_NOT_EMPTY:
|
||||
case E_INVALID_PROXY:
|
||||
bFatal = FALSE;
|
||||
default:
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче