summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael P. Soulier <msoulier@digitaltorque.ca>2011-06-02 22:31:55 -0400
committerMichael P. Soulier <msoulier@digitaltorque.ca>2011-06-02 22:31:55 -0400
commit6fd9391ad86fe58cf73dabce452d5d14c0d9ac32 (patch)
treed1a2906cad5f63d43ebbd579a84bfe4ee868474d
parentf6442eb4e40fe19ab7d210d068c8a63b025d12c9 (diff)
downloadtftpy-6fd9391ad86fe58cf73dabce452d5d14c0d9ac32.tar.gz
Fixing a file descriptor leak. Closes issue 22.
-rwxr-xr-xrun_tests3
-rw-r--r--tftpy/TftpStates.py1
2 files changed, 4 insertions, 0 deletions
diff --git a/run_tests b/run_tests
new file mode 100755
index 0000000..3dc0ecd
--- /dev/null
+++ b/run_tests
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+PYTHONPATH=. python t/test.py
diff --git a/tftpy/TftpStates.py b/tftpy/TftpStates.py
index 142029c..6c77499 100644
--- a/tftpy/TftpStates.py
+++ b/tftpy/TftpStates.py
@@ -156,6 +156,7 @@ class TftpContext(object):
continue
break
else:
+ self.sock.close()
raise TftpException, "Hit max timeouts, giving up."
# Ok, we've received a packet. Log it.