From 6272b848234d63ce193abc6996b2eec9b2af5cb7 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 30 Apr 2011 19:16:47 +0200 Subject: closed #290, #291, #292 --- module/network/RequestFactory.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'module/network/RequestFactory.py') diff --git a/module/network/RequestFactory.py b/module/network/RequestFactory.py index 90a48fe3c..e91b9ea41 100644 --- a/module/network/RequestFactory.py +++ b/module/network/RequestFactory.py @@ -54,6 +54,10 @@ class RequestFactory(): self.lock.release() return req + def getHTTPRequest(self): + """ returns a http request, dont forget to close it ! """ + return HTTPRequest(None, self.iface(), self.getProxies()) + def getURL(self, url, get={}, post={}, multipart=False): h = HTTPRequest(None, self.iface(), self.getProxies()) rep = h.load(url, get, post, multipart=multipart) @@ -76,7 +80,7 @@ class RequestFactory(): type = "http" setting = self.core.config["proxy"]["type"].lower() if setting == "socks4": type = "socks4" - if setting == "socks5": type = "socks5" + elif setting == "socks5": type = "socks5" username = None if self.core.config["proxy"]["username"] and self.core.config["proxy"]["username"].lower() != "none": @@ -103,4 +107,7 @@ class RequestFactory(): # needs pyreq in global namespace def getURL(*args, **kwargs): - return pyreq.getURL(*args, **kwargs) \ No newline at end of file + return pyreq.getURL(*args, **kwargs) + +def getRequest(*args, **kwargs): + return pyreq.getHTTPRequest() \ No newline at end of file -- cgit v1.2.3