summaryrefslogtreecommitdiffstats
path: root/module/network
diff options
context:
space:
mode:
Diffstat (limited to 'module/network')
-rw-r--r--module/network/Browser.py7
-rw-r--r--module/network/HTTPRequest.py4
2 files changed, 11 insertions, 0 deletions
diff --git a/module/network/Browser.py b/module/network/Browser.py
index 23cf7666b..d68a23687 100644
--- a/module/network/Browser.py
+++ b/module/network/Browser.py
@@ -112,6 +112,13 @@ class Browser(object):
if "auth" in self.options: del self.options["auth"]
self.renewHTTPRequest()
+ def setOption(self, name, value):
+ """Adds an option to the request, see HTTPRequest for existing ones"""
+ self.options[name] = value
+
+ def deleteOption(self, name):
+ if name in self.options: del self.options[name]
+
def clearHeaders(self):
self.http.clearHeaders()
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py
index 6672a58e6..bd8cdd72e 100644
--- a/module/network/HTTPRequest.py
+++ b/module/network/HTTPRequest.py
@@ -118,6 +118,10 @@ class HTTPRequest():
if "auth" in options:
self.c.setopt(pycurl.USERPWD, str(options["auth"]))
+ if "timeout" in options:
+ self.c.setopt(pycurl.LOW_SPEED_TIME, options["timeout"])
+
+
def addCookies(self):
""" put cookies from curl handle to cj """
if self.cj: