[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: [PATCH]Automatic proxy configuration
From: Waldo Bastian <bastian () kde ! org>
Date: 2001-07-30 5:12:57
[Download RAW message or body]
Hiya,
My kfmclient crashes on the automatic proxy config stuff. The following patch
seems to solve it. The problem may be related to the fact that the actual
script causes a parse error.
I also notice that a job is created to "download" the script. That seems
unnecassery since the script is in a local file.
Cheers,
Waldo
--
Andrei Sakharov, Exiled 1980-1986, USSR, http://www.aip.org/history/sakharov/
Dmitry Sklyarov, Detained 2001-????, USA, http://www.elcomsoft.com/
["kprotocolmanager.diff" (text/x-diff)]
Index: kprotocolmanager.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kprotocolmanager.cpp,v
retrieving revision 1.96
diff -u -3 -d -p -r1.96 kprotocolmanager.cpp
--- kprotocolmanager.cpp 2001/06/28 23:52:19 1.96
+++ kprotocolmanager.cpp 2001/07/30 05:09:16
@@ -46,6 +46,7 @@ public:
KConfig *config;
KConfig *http_config;
KPAC *pac;
+ bool init_busy;
KURL url;
QString protocol;
QString proxy;
@@ -56,7 +57,7 @@ public:
static KStaticDeleter<KProtocolManagerPrivate> kpmpksd;
KProtocolManagerPrivate::KProtocolManagerPrivate()
- : config(0), http_config(0), pac(0)
+ : config(0), http_config(0), pac(0), init_busy(false)
{
kpmpksd.setObject(this);
}
@@ -112,26 +113,30 @@ KPAC *KProtocolManager::pac()
if (!d->pac)
{
+ if (d->init_busy) return 0;
+ d->init_busy = true;
+
KLibrary *lib = KLibLoader::self()->library("libkpac");
if (lib)
{
KPAC *(*create_pac)() = (KPAC *(*)())(lib->symbol("create_pac"));
if (create_pac)
{
- d->pac = create_pac();
- // Need to set d->pac here to avoid infinite recursion
+ KPAC *newPAC = create_pac();
switch (type)
{
case PACProxy:
- d->pac->init( proxyConfigScript() );
+ newPAC->init( proxyConfigScript() );
break;
case WPADProxy:
- d->pac->discover();
+ newPAC->discover();
default:
break;
}
+ d->pac = newPAC;
}
}
+ d->init_busy = false;
}
return d->pac;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic