diff options
| author | Reiner Herrmann <reiner@reiner-h.de> | 2019-03-03 14:02:17 +0100 |
|---|---|---|
| committer | Reiner Herrmann <reiner@reiner-h.de> | 2019-03-03 14:02:17 +0100 |
| commit | a62e0c10aed3639aedb0c228c7685926b391aae8 (patch) | |
| tree | 3b37b1de5cc323d1755005439084aa6ff0a39e7c /src/lib.rs | |
| parent | 960ea9072b03cf265a113c2ff978c0d2fb4735a3 (diff) | |
Implement Transfer Size Option (RFC 2349, part 2)
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -24,6 +24,7 @@ pub enum Opcodes { pub struct TftpOptions { blksize: usize, timeout: u8, + tsize: usize, } pub struct Tftp { @@ -34,6 +35,7 @@ fn default_options() -> TftpOptions { TftpOptions { blksize: 512, timeout: 3, + tsize: 0, } } @@ -142,6 +144,15 @@ impl Tftp { _ => false } } + "tsize" => { + match val.parse() { + Ok(t) => { + self.options.tsize = t; + true + } + _ => false + } + } _ => false } }); |
