# HG changeset patch # User Matt Johnston # Date 1339808920 -28800 # Node ID f9a7e872c8689eccfa4946f2a95a0f8620c6a364 # Parent a670a67ba4891dcd209d23051445362b55271010# Parent 4bfa9b7b2e4bdf61a08db52a5e4e17f1452e09bd merge diff -r a670a67ba489 -r f9a7e872c868 server/ts.py --- a/server/ts.py Sat Jun 16 09:07:38 2012 +0800 +++ b/server/ts.py Sat Jun 16 09:08:40 2012 +0800 @@ -19,6 +19,8 @@ import binascii import hmac import zlib +import urllib +import urllib2 import config @@ -57,7 +59,6 @@ print>>sys.stderr, "Bad expected START line '%s'\n" % l.rstrip('\n') return None crc = crc16(l, crc) - lines.append(l) while True: l = readline(sock) @@ -122,9 +123,9 @@ def send_results(lines): enc_lines = binascii.b2a_base64(zlib.compress('\n'.join(lines))) - hmac.new(config.HMAC_KEY, enc_lines).hexdigest() + mac = hmac.new(config.HMAC_KEY, enc_lines).hexdigest() - url_data = urllib.url_encode( ('lines', enc_lines), ('hmac', mac) ) + url_data = urllib.urlencode( {'lines': enc_lines, 'hmac': mac} ) con = urllib2.urlopen(config.UPDATE_URL, url_data) result = con.read(100) if result == 'OK':