some debug output in web_server.py

This commit is contained in:
Arvid Norberg 2015-01-11 07:45:06 +00:00
parent 790bdb3855
commit b56b3613fe
2 changed files with 5 additions and 3 deletions

View File

@ -140,10 +140,12 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
if chunked_encoding: if chunked_encoding:
s.wfile.write('%x\r\n' % to_send) s.wfile.write('%x\r\n' % to_send)
data = f.read(to_send) data = f.read(to_send)
print 'read %d bytes' % to_send
s.wfile.write(data) s.wfile.write(data)
if chunked_encoding: if chunked_encoding:
s.wfile.write('\r\n') s.wfile.write('\r\n')
length -= to_send length -= to_send
print 'sent %d bytes (%d bytes left)' % (len(data), length)
if chunked_encoding: if chunked_encoding:
s.wfile.write('0\r\n\r\n') s.wfile.write('0\r\n\r\n')
except Exception, e: except Exception, e: