summaryrefslogtreecommitdiff
path: root/tftpy/TftpServer.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix race condition when waiting for ACKMarcin Lewandowski2022-03-231-0/+5
| | | | | | | | | | | | | | | | | | TFTPy is designed in a way that socket timeout is used to calculate timeout when waiting for packet. During that time another unexpected packet may arrive. After that the socket operation is restarted and timeout is calculated from start. This might be a problem because both sides have timeout and these timeout may be different or one host may be significantly faster that another. In such situation the timeout will be never triggered as another host will always retransmit his packet faster. For most cases it does not matter because TFTP is always responding to packet sent and transmission may continue. The only one exception is no response to duplicate ACK. It is necessary to prevent Sorcerer's Apprentice Syndrome. This patch introduces additional exception TftpTimeoutExpectACK raised when reaching timeout during waiting on ACK of current block but receiving duplicate ACK of previous block.
* Merged PR 104Michael P. Soulier2021-12-031-2/+5
|\
| * TftpServer: lower log level for clean shutdown msgsRafael Gago2019-09-171-3/+4
| | | | | | | | | | | | | | | | | | Before this commit all clean shutdown sequences (without active sessions) were issuing warnings on the logs. Closing the server without active sessions is normal behavior, so it should not generate error messages. This commit fixes this.
* | run pyupgradeadehad2021-10-231-6/+5
| |
* | re-lint after mergeadehad2021-10-211-9/+12
| |
* | Merge remote-tracking branch 'upstream/master'adehad2021-10-211-16/+12
|\ \
| * | Enhance PEP8Richard Vézina2021-10-151-0/+1
| | |
| * | is NoneRichard Vézina2021-10-151-1/+1
| | |
| * | Improve natural english language readabilityRichard Vézina2021-10-151-1/+1
| | |
| * | No inline ifRichard Vézina2021-10-151-1/+2
| | |
| * | Create list directlyRichard Vézina2021-10-151-2/+1
| | |
| * | 120 is good (80 -> 120 line length)Richard Vézina2021-10-151-25/+12
| | |
| * | Optimize importsRichard Vézina2021-10-151-6/+8
| | |
* | | first attempt with github actions, various lintingadehad2021-10-111-49/+63
|/ /
* | Merge pull request #115 from graingert/patch-1Michael P. Soulier2021-05-201-1/+1
|\ \ | | | | | | allow overriding select timeout in listen
| * | allow overriding select timeout in listenThomas Grainger2021-02-011-1/+1
| |/
* | Add retires paramater to client and server sessionsisraelv2021-03-111-2/+3
| |
* | Add retires to context initializersisraelv2021-03-111-1/+1
|/
* 2to3¨Andreas2018-09-101-2/+2
| | | | Not finished, a few type conversion errors still occur.2to3
* Adding some boilerplateMichael P. Soulier2018-05-181-0/+2
|
* Rationalized module includes and logging.Michael P. Soulier2018-05-151-0/+3
|
* Fix some deprecations and python3 incompatibilitiessedrubal2018-04-041-7/+6
|
* Merged style updates, minor bug fixesMichael P. Soulier2017-05-091-22/+21
|\
| * Release version 0.6.3_fork (forked version)Francesco Fiorentino2015-07-211-36/+45
| | | | | | | | | | | | | | | | Contains: Bug fixes in log.debug Fixes in broken code Fixes many PEP8 issues Created testWin Unit for Win environment
* | Merge branch 'master' into dynamicPaul Weaver2016-07-071-76/+49
|\ \ | | | | | | | | | | | | | | | | | | To resolve conflict with latest changes on master Conflicts: tftpy/TftpServer.py
| * | Fixing some python3 syntax errorsMichael P. Soulier2016-07-051-1/+1
| | |
| * | Added recommended imports for python3 compatibility.Michael P. Soulier2016-07-051-0/+1
| | |
| * | Merging with masterMichael P. Soulier2016-07-041-4/+11
| |\ \
| | * | Revert "listen loop: Use epoll / poll instead of select"Michael P. Soulier2016-07-041-64/+36
| | | | | | | | | | | | | | | | This reverts commit f2ce9119d929b2040204e0aaadfac6d5f7e830d4.
| * | | Adding python3 supportDoug O'Riordan2015-03-051-15/+15
| | |/ | |/|
* | | Add a context to dynamic upload_openPaul Weaver2016-06-171-2/+2
| | |
* | | Implement dynamic upload supportPaul Weaver2016-06-171-12/+26
| | |
* | | Clarify docs around dyn_file_func in TftpServerPaul Weaver2016-06-171-3/+4
| |/ |/|
* | listen loop: Use epoll / poll instead of selectCarl van Schaik2016-04-121-36/+64
| | | | | | | | | | | | | | | | | | Update the main server loop to use more efficient epoll, or if not available, poll. This removes work recreating the select list on each itteration. Also add a dictionary to speed up translation of file descriptor back to a matching session.
* | tests: fix failure due to alarmCarl van Schaik2016-04-121-4/+11
|/ | | | | | | Test cases raises an alarm in the server to call the stop() function. This actually interrupts the select system call and raises an exception instead. We catch the interrupted syscall in select and allow it to restart.
* Added a comment.Michael P. Soulier2014-09-061-0/+2
|
* Set listenport to the port chosen by bind()Philip Derrin2014-06-021-0/+1
| | | | | | The server can be run with listenport=0, in which case bind() will select a port. In this case, it can be useful to inspect the port number, so we set self.listenport.
* Set an event while TftpServer.listen() runsPhilip Derrin2014-06-021-0/+6
| | | | | | Most non-trivial uses of TftpServer.listen() are in a dedicated thread. In this case, it can be useful to wait until the server thread is running, so we signal this with a threading.Event.
* Added tests for server api stop.Michael P. Soulier2013-09-271-4/+4
|
* Fixing debug calls to be lazy when debug is off.Michael P. Soulier2013-09-261-13/+12
|
* Adding graceful exit condition.Michael P. Soulier2013-07-271-0/+6
|
* Adding a TftpServer.stop() method.Michael P. Soulier2013-07-271-0/+31
|
* Removing trailing whitespaceMichael P. Soulier2012-10-041-1/+1
|
* improve the check on dyn_file_func of TftpServerMichael Farrell2012-04-121-3/+3
|
* allow TftpServer.root not to exist if a dyn_file_func is providedMichael Farrell2012-04-111-2/+5
|
* Fixing some pyflakes complaintsMichael P. Soulier2011-07-231-2/+1
|
* Fixes issue #23, breaking up TftpStates into TftpStates and TftpContexts.Michael P. Soulier2011-07-231-2/+2
|
* Adding retries on timeouts, still have to exhaustively test.Michael P. Soulier2011-07-231-2/+10
| | | | Should close issue #21 on github.
* Fix exceptions propagating out of TftpServer.listen()Kenny Millington2010-10-221-1/+6
| | | | Signed-off-by: Michael P. Soulier <msoulier@digitaltorque.ca>
* Latest doc updatesMichael P. Soulier2010-07-111-6/+11
|