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
This commit is contained in:
parent
59c0881235
commit
55688c14ed
1 changed files with 1 additions and 1 deletions
|
@ -286,7 +286,7 @@ function tftp:listen(rrq_generator_callback, wrq_generator_callback, hosts, port
|
||||||
}```
|
}```
|
||||||
On error, responds to the client with an ERROR packet, and returns nil.
|
On error, responds to the client with an ERROR packet, and returns nil.
|
||||||
]]
|
]]
|
||||||
local okay, generator, tsize = pcall(callbacks[request.opcode], request.filename)
|
local okay, generator, tsize = pcall(callbacks[request.opcode], request.filename, host, port)
|
||||||
if not okay then
|
if not okay then
|
||||||
requestsocket:sendto(self.ERROR(ERR_NOTFOUND), host, port)
|
requestsocket:sendto(self.ERROR(ERR_NOTFOUND), host, port)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue