Fix exceptions propagating out of TftpServer.listen()
Signed-off-by: Michael P. Soulier <msoulier@digitaltorque.ca>master
parent
71d827dd89
commit
a6cff4f0b2
|
@ -107,7 +107,12 @@ class TftpServer(TftpSession):
|
||||||
timeout,
|
timeout,
|
||||||
self.root,
|
self.root,
|
||||||
self.dyn_file_func)
|
self.dyn_file_func)
|
||||||
|
try:
|
||||||
self.sessions[key].start(buffer)
|
self.sessions[key].start(buffer)
|
||||||
|
except TftpException, err:
|
||||||
|
deletion_list.append(key)
|
||||||
|
log.error("Fatal exception thrown from "
|
||||||
|
"session %s: %s" % (key, str(err)))
|
||||||
else:
|
else:
|
||||||
log.warn("received traffic on main socket for "
|
log.warn("received traffic on main socket for "
|
||||||
"existing session??")
|
"existing session??")
|
||||||
|
|
|
@ -115,7 +115,7 @@ class TftpContext(object):
|
||||||
called explicitely by the calling code, this works better than the
|
called explicitely by the calling code, this works better than the
|
||||||
destructor."""
|
destructor."""
|
||||||
log.debug("in TftpContext.end")
|
log.debug("in TftpContext.end")
|
||||||
if not self.fileobj.closed:
|
if self.fileobj is not None and not self.fileobj.closed:
|
||||||
log.debug("self.fileobj is open - closing")
|
log.debug("self.fileobj is open - closing")
|
||||||
self.fileobj.close()
|
self.fileobj.close()
|
||||||
|
|
||||||
|
|
Reference in New Issue