Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yurivict committed May 18, 2015
1 parent f73ecdb commit a8c19cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tiny-udp-proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def tm_ms():
global timer_process_start
return '%0.3f' % (timer() - timer_process_start)
def log(s):
print("LOG %s" % (s))
print("%s" % (s))
with open(logfile(), "a") as myfile:
myfile.write('%s %s %s\n' % (tm_ms(), tu.tm_log(), s))
def log_pkt(is_req, ip, port, data):
Expand Down Expand Up @@ -374,6 +374,9 @@ def create_sock_raw_ip():
if not os.geteuid()==0:
sys.exit("Only root can run tiny-udp-proxy")

# start time
timer_process_start = timer()

## starting
tu.mk_file_rw(logfile())
log('starting')
Expand All @@ -395,9 +398,6 @@ def create_sock_raw_ip():
all_sockets_v.append(sock_clnt)
sock_clnt_w = create_sock_raw_ip()

# start time
timer_process_start = timer()

# main event loop
while True:
# select
Expand Down

0 comments on commit a8c19cd

Please sign in to comment.