From 765871bd118926dfb265f2b8f67cfd2b3558d6ee Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 7 Mar 2011 13:46:02 +1300 Subject: Store timestamps on flow components as a UTC time tuple. Format is: (tm_year,tm_mon,tm_mday,tm_hour,tm_min, tm_sec,tm_wday,tm_yday,tm_isdst) --- libmproxy/proxy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libmproxy/proxy.py') diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 2a2904e5..a4dc3e69 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -5,7 +5,7 @@ Development started from Neil Schemenauer's munchy.py """ -import sys, os, time, string, socket, urlparse, re, select, copy, base64 +import sys, os, string, socket, urlparse, re, select, copy, base64 import shutil, tempfile import optparse, SocketServer, ssl import utils, controller @@ -132,7 +132,7 @@ class Request(controller.Msg): self.client_conn = client_conn self.host, self.port, self.scheme = host, port, scheme self.method, self.path, self.headers, self.content = method, path, headers, content - self.timestamp = timestamp or time.time() + self.timestamp = timestamp or utils.timestamp() self.close = False controller.Msg.__init__(self) @@ -262,7 +262,7 @@ class Response(controller.Msg): self.request = request self.code, self.msg = code, msg self.headers, self.content = headers, content - self.timestamp = timestamp or time.time() + self.timestamp = timestamp or utils.timestamp() self.cached = False controller.Msg.__init__(self) self.replay = False @@ -376,7 +376,7 @@ class ClientConnect(controller.Msg): class Error(controller.Msg): def __init__(self, request, msg, timestamp=None): self.request, self.msg = request, msg - self.timestamp = timestamp or time.time() + self.timestamp = timestamp or utils.timestamp() controller.Msg.__init__(self) def load_state(self, state): -- cgit v1.2.3