Closed kjyrinki-unikie closed 6 months ago
Hey! Thank you for checking out rs-tftpd. Would you like to send a PR for this? If not, I will check it out whenever I have some time.
I can provide PR.
Hey, I've tried reproducing this but couldn't, which TFTP client are you using, and can you share the commands you used to start the server with?
Also, if you can share which commands you are using for the client, that would be great.
Originally I had my own code which included client, but i tested it also with https://github.com/ClausKlein/tftp-hpa
Server started: tftpd -p 10069 -s
Client: ./tftp -w 10 127.0.0.1 10069 -m octet -c get testi.png
Fixed with d041159
This issue is visible with single socket case when you send READ request with option(s). accept_request & check_response: After sending OACK server starts to wait ACK as response from client, but in single socket case recv_with_size() waits data from mpsc channel. I guess a problem is that listen() which is maybe supposed to receive ACK and send data to channel don't get run. I.e. we don't have worker yet (or thread) to handle ACK response for OACK. So basically in
impl Socket for ServerSocket
functionfn recv_with_size(&self, _size: usize) -> Result<Packet, Box<dyn Error>>
hangs onif let Ok(packet) = receiver.recv_timeout(self.timeout)
until timeout occurs.