summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Leuenberger <dimstar@opensuse.org>2020-11-10 15:49:42 +0100
committerGitHub <noreply@github.com>2020-11-10 15:49:42 +0100
commit160d9bd2718293484d836892b1cdddafa5cb78ce (patch)
tree05c346ed0ab4056ce4d380446dcab8b263b8a17c
parentd3b6d8767b2147d2f14c974d5bd7a0dbfae63c62 (diff)
parent89bb1053bed5c5ab21b51f037f8481b8f898961f (diff)
downloadlibproxy-git-160d9bd2718293484d836892b1cdddafa5cb78ce.tar.gz
Merge pull request #128 from mcatanzaro/mcatanzaro/#68
Remove nonfunctional and crashy pacrunner caching
-rw-r--r--libproxy/extension_pacrunner.cpp10
-rw-r--r--libproxy/extension_pacrunner.hpp4
-rw-r--r--libproxy/proxy.cpp4
3 files changed, 4 insertions, 14 deletions
diff --git a/libproxy/extension_pacrunner.cpp b/libproxy/extension_pacrunner.cpp
index de2ea7b..698f25f 100644
--- a/libproxy/extension_pacrunner.cpp
+++ b/libproxy/extension_pacrunner.cpp
@@ -23,19 +23,11 @@ using namespace libproxy;
pacrunner::pacrunner(const string &, const url&) {}
pacrunner_extension::pacrunner_extension() {
- this->pr = NULL;
}
pacrunner_extension::~pacrunner_extension() {
- if (this->pr) delete this->pr;
}
pacrunner* pacrunner_extension::get(const string &pac, const url& pacurl) {
- if (this->pr) {
- if (this->last == pac)
- return this->pr;
- delete this->pr;
- }
-
- return this->pr = this->create(pac, pacurl);
+ return this->create(pac, pacurl);
}
diff --git a/libproxy/extension_pacrunner.hpp b/libproxy/extension_pacrunner.hpp
index eeb30f9..4834eb9 100644
--- a/libproxy/extension_pacrunner.hpp
+++ b/libproxy/extension_pacrunner.hpp
@@ -56,10 +56,6 @@ public:
protected:
// Abstract methods
virtual pacrunner* create(string pac, const url& pacurl) =0;
-
-private:
- pacrunner* pr;
- string last;
};
}
diff --git a/libproxy/proxy.cpp b/libproxy/proxy.cpp
index 72d0039..5db3033 100644
--- a/libproxy/proxy.cpp
+++ b/libproxy/proxy.cpp
@@ -416,7 +416,9 @@ void proxy_factory::run_pac(url &realurl, const url &confurl, vector<string> &re
/* Run the PAC, but only try one PACRunner */
if (debug) cerr << "Using pacrunner: " << typeid(*pacrunners[0]).name() << endl;
- string pacresp = pacrunners[0]->get(this->pac, this->pacurl->to_string())->run(realurl);
+ pacrunner* runner = pacrunners[0]->get(this->pac, this->pacurl->to_string());
+ string pacresp = runner->run(realurl);
+ delete runner;
if (debug) cerr << "Pacrunner returned: " << pacresp << endl;
format_pac_response(pacresp, response);
}