Implement flow control for tftp.
* grub-core/net/net.c (receive_packets): Decrease the stop to 10 packets but stop only if stop condition is satisfied. (grub_net_fs_read_real): Call packets_pulled after real read. Use `stall' instead of `eof' as stop condition. * grub-core/net/http.c (parse_line): Set `stall' on EOF. (http_err): Likewise. * grub-core/net/tftp.c (ack): Replace the first argument with data instead of socket. (tftp_receive): Stall if too many packets are in wait queue. (tftp_packets_pulled): New function. (grub_tftp_protocol): Set packets_pulled. * include/grub/net.h (grub_net_packets): New field count. (grub_net_put_packet): Increment count. (grub_net_remove_packet): Likewise. (grub_net_app_protocol): New field `packets_pulled'. (grub_net): New field `stall'.
Showing
- ChangeLog 21 additions, 0 deletionsChangeLog
- grub-core/net/http.c 2 additions, 0 deletionsgrub-core/net/http.c
- grub-core/net/net.c 13 additions, 6 deletionsgrub-core/net/net.c
- grub-core/net/tftp.c 35 additions, 8 deletionsgrub-core/net/tftp.c
- include/grub/net.h 7 additions, 0 deletionsinclude/grub/net.h
Loading
Please register or sign in to comment