summaryrefslogtreecommitdiff
path: root/src/libwebvi/webvi/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/libwebvi/webvi/request.py')
-rw-r--r--src/libwebvi/webvi/request.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libwebvi/webvi/request.py b/src/libwebvi/webvi/request.py
index 87dcf87..cab15f7 100644
--- a/src/libwebvi/webvi/request.py
+++ b/src/libwebvi/webvi/request.py
@@ -24,12 +24,14 @@ import download
import sys
import utils
import json2xml
+import asyncurl
from constants import WebviRequestType
DEBUG = False
DEFAULT_TEMPLATE_PATH = '/usr/local/share/webvi/templates'
template_path = DEFAULT_TEMPLATE_PATH
+timeout_data = None
def debug(msg):
if DEBUG:
@@ -49,6 +51,10 @@ def set_template_path(path):
debug("set_template_path " + template_path)
+def set_timeout_callback(callback):
+ c_api_callback = lambda mdisp, timeout: callback(timeout, timeout_data)
+ asyncurl.multi_dispatcher.timeout_callback = c_api_callback
+
def parse_reference(reference):
"""Parses URLs of the following form: