Browse Source

fix mudbjson mode

dev
BreakWa11 8 years ago
parent
commit
6255a1d321
  1. 3
      db_transfer.py

3
db_transfer.py

@ -128,6 +128,7 @@ class DbTransfer(object):
port = row['port']
passwd = common.to_bytes(row['passwd'])
cfg = {'password': passwd}
if 'id' in row:
self.port_uid_table[row['port']] = row['id']
read_config_keys = ['method', 'obfs', 'obfs_param', 'protocol', 'protocol_param', 'forbidden_ip', 'forbidden_port']
@ -181,6 +182,7 @@ class DbTransfer(object):
else:
logging.info('db stop server at port [%s] reason: port not exist' % (row['port']))
ServerPool.get_instance().cb_del_server(row['port'])
if row['port'] in self.port_uid_table:
del self.port_uid_table[row['port']]
if len(new_servers) > 0:
@ -260,6 +262,7 @@ class Dbv3Transfer(DbTransfer):
query_sub_when2 += ' WHEN %s THEN d+%s' % (id, transfer[1])
cur = conn.cursor()
if id in self.port_uid_table:
cur.execute("INSERT INTO `user_traffic_log` (`id`, `user_id`, `u`, `d`, `Node_ID`, `rate`, `traffic`, `log_time`) VALUES (NULL, '" + \
str(self.port_uid_table[id]) + "', '" + str(transfer[0]) + "', '" + str(transfer[1]) + "', '" + \
str(get_config().NODE_ID) + "', '" + str(get_config().TRANSFER_MUL) + "', '" + \

Loading…
Cancel
Save