Commit Graph

16 Commits (main)

Author SHA1 Message Date
Daniel Barlow 8798ee9830 partial fix for timeout handling
1) "Unknown transfer id" message was because the local variable "tid"
is not a transfer id, it is a sequence number  - so the check was
actually comparing expected vs actual acknowledged sequence number,
not TID.  It's still a problem if we get the wrong one, but it
indicates a lost packet (so we should resend) not a packet that was
sent from somewhere else.

2) if the ACK packet has not been received, our retry should involve
_resending_ it, not just trying to wait for it again.

3) I have removed the timeout condition for terminating the resend
loop, because in practice (assuming both ends have the same timeout
setting) all it did was ensure that the loop only ran once. The
timeout is supposed to regulate how long we wait for before retrying
(it doesn't do this, we wait indefinitely), not how long we wait for
before giving up.
2023-10-18 23:35:23 +01:00
Daniel Barlow b438a0fd17 handlersocket must be bound before calling select()
this is due to a rather odd (imo) decision in luasocket which
says that the underlying socket (and therefore its file
descriptor) isn't actually created until we call something
that lets it work out whether ipv4 or ipv6
2023-02-15 22:06:28 +00:00
Daniel Barlow 2388e4ca24 recvfrom(-1) is not the same as recvfrom() 2023-02-15 22:06:28 +00:00
Daniel Barlow f98b9c5c97 add README to say where Tufted came from 2023-02-15 22:06:28 +00:00
Daniel Barlow 1a29e2ba0f use locally modified tftp.lua instead of upstream tufty 2023-02-15 22:06:28 +00:00
Daniel Barlow 118f78f334 remove "using luasocket" message 2023-02-15 22:06:28 +00:00
Daniel Barlow a258456f25 check return value of bind
is common to forget to run this as root, in which case we would like
to see the permission denied error when it tries to open port 69
2023-02-15 22:06:28 +00:00
Daniel Barlow 71e37f1b96 update `listen` docstring 2023-02-15 22:06:28 +00:00
Daniel Barlow 55688c14ed pass remote host and port to callback as params 2..3
This allows the callback to handle the response differently
depending on who is asking - for example, to refuse requests
from clients on a blocklist
2023-02-15 22:06:28 +00:00
Daniel Barlow 59c0881235 remove unhelpful debug message 2023-02-15 22:06:28 +00:00
Daniel Barlow 1b372bcb2b simpler eof handling 2023-02-15 22:06:28 +00:00
Daniel Barlow b84a6e0aa5 fix poll() to not mutate its parameter 2023-02-15 22:06:28 +00:00
Daniel Barlow d729709869 remove nixio support 2023-02-15 22:06:28 +00:00
Daniel Barlow 740314b329 added at 3cb95c869e2fe74cc61ca303d88af6c5daad6734 2023-02-15 22:06:28 +00:00
Daniel Barlow 52d8c03ddd update tufted for nixpkgs fennel changes 2023-02-07 23:42:19 +00:00
Daniel Barlow e7987c9520 add build-host tftp server 2022-10-04 23:08:43 +01:00