|
@@ -335,6 +335,7 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
|
|
|
action = query['action'] if 'action' in query else None
|
|
|
remote = query['remote'] if 'remote' in query else None
|
|
|
gw = query['gw'] if 'gw' in query else None
|
|
|
+ ts = query['ts'] if 'ts' in query else time.time()
|
|
|
|
|
|
if action == 'list':
|
|
|
self.respond_vpnlist()
|
|
@@ -371,7 +372,7 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
|
|
|
|
|
|
if action == 'establish':
|
|
|
item['active'][gw] = {
|
|
|
- 'establish': time.time(),
|
|
|
+ 'establish': ts,
|
|
|
'peer': peername,
|
|
|
'remote': remote,
|
|
|
'remote_raw': remote_raw,
|
|
@@ -382,7 +383,7 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
|
|
|
if gw in item['active']:
|
|
|
active = item['active'][gw]
|
|
|
del(item['active'][gw])
|
|
|
- active['disestablish'] = time.time()
|
|
|
+ active['disestablish'] = ts
|
|
|
item['last'][gw] = active
|
|
|
else:
|
|
|
self.send_error(500, 'Unknown action not filtered (' + str(action) + ')')
|