From e269bec1053f059ba0fd701c1e7fa1ad424726bc Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 12 May 2011 21:57:53 +0200 Subject: some fixes, closed #306 --- module/network/RequestFactory.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'module/network/RequestFactory.py') diff --git a/module/network/RequestFactory.py b/module/network/RequestFactory.py index 27854e95e..9b32ed570 100644 --- a/module/network/RequestFactory.py +++ b/module/network/RequestFactory.py @@ -43,7 +43,7 @@ class RequestFactory(): if type == "XDCC": return XDCCRequest(proxies=self.getProxies()) - req = Browser(self.iface(), self.bucket, self.getProxies()) + req = Browser(self.bucket, self.getOptions()) if account: cj = self.getCookieJar(pluginName, account) @@ -56,10 +56,10 @@ class RequestFactory(): def getHTTPRequest(self): """ returns a http request, dont forget to close it ! """ - return HTTPRequest(CookieJar(None), self.iface(), self.getProxies()) + return HTTPRequest(CookieJar(None), self.getOptions()) def getURL(self, url, get={}, post={}, multipart=False): - h = HTTPRequest(None, self.iface(), self.getProxies()) + h = HTTPRequest(None, self.getOptions()) rep = h.load(url, get, post, multipart=multipart) h.close() return rep @@ -96,7 +96,13 @@ class RequestFactory(): "port": self.core.config["proxy"]["port"], "username": username, "password": pw, - } + } + + def getOptions(self): + """returns options needed for pycurl""" + return {"interface": self.iface(), + "proxies": self.getProxies(), + "ipv6": self.core.config["download"]["ipv6"]} def updateBucket(self): """ set values in the bucket according to settings""" @@ -109,5 +115,6 @@ class RequestFactory(): def getURL(*args, **kwargs): return pyreq.getURL(*args, **kwargs) + def getRequest(*args, **kwargs): return pyreq.getHTTPRequest() \ No newline at end of file -- cgit v1.2.3