diff options
Diffstat (limited to 'plugins/mozjs.c')
-rw-r--r-- | plugins/mozjs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mozjs.c b/plugins/mozjs.c index af91fea..77a0c13 100644 --- a/plugins/mozjs.c +++ b/plugins/mozjs.c @@ -222,17 +222,21 @@ static int mozjs_set_proxy(struct pacrunner_proxy *proxy) return 0; } -static char * mozjs_execute(const char *url, const char *host) +static char * mozjs_execute(struct pacrunner_proxy *proxy, const char *url, + const char *host) { JSBool result; jsval rval, args[2]; char *answer, *g_answer; - DBG("url %s host %s", url, host); + DBG("proxy %p url %s host %s", proxy, url, host); if (!jsctx) return NULL; + if (proxy != current_proxy && mozjs_set_proxy(proxy)) + return NULL; + pthread_mutex_lock(&mozjs_mutex); JS_BeginRequest(jsctx); |