Add protocol logging
This commit is contained in:
parent
b5cdd379cd
commit
ade4503355
1 changed files with 2 additions and 2 deletions
4
neomi.py
4
neomi.py
|
@ -571,13 +571,13 @@ class Serve(threading.Thread):
|
||||||
file = get_file(full_path, config = self.config)
|
file = get_file(full_path, config = self.config)
|
||||||
|
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
log('%s: Requested path not found: %s' % (self.address, path))
|
log('%s [%s]: Requested path not found: %s' % (self.address, protocol.name, path))
|
||||||
reader = StringReader('%s not found\n' % path)
|
reader = StringReader('%s not found\n' % path)
|
||||||
send_header(self.sock, protocol, Status.notfound, 'text/plain', config = self.config)
|
send_header(self.sock, protocol, Status.notfound, 'text/plain', config = self.config)
|
||||||
send_file(self.sock, reader, protocol, 'text/plain', config = self.config)
|
send_file(self.sock, reader, protocol, 'text/plain', config = self.config)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
log('%s requested path %s' % (self.address, path))
|
log('%s [%s] requested path %s' % (self.address, protocol.name, path))
|
||||||
reader = FileReader(file)
|
reader = FileReader(file)
|
||||||
|
|
||||||
send_header(self.sock, protocol, Status.ok, mimetype, config = self.config)
|
send_header(self.sock, protocol, Status.ok, mimetype, config = self.config)
|
||||||
|
|
Loading…
Reference in a new issue