[verified] feat(tui): fail-closed /file transfer (1 MiB)
All checks were successful
ci / test (pull_request) Successful in 3m9s
All checks were successful
ci / test (pull_request) Successful in 3m9s
Typed fil frames chunk a local file to the selected friend over the existing one-shot pipe. Receive-side 1 MiB cap, basename-only names, hash check before rename, never overwrite. Chat shows [file] name only.
This commit is contained in:
parent
c4ccca7e8c
commit
0ea6fd68c4
10 changed files with 641 additions and 8 deletions
|
|
@ -8,6 +8,7 @@ pub enum Kind {
|
|||
Invoice,
|
||||
Receipt,
|
||||
Ping,
|
||||
File,
|
||||
Drop,
|
||||
}
|
||||
|
||||
|
|
@ -27,6 +28,9 @@ pub fn classify(pt: &[u8]) -> Kind {
|
|||
if pt.starts_with(b"png ") {
|
||||
return Kind::Ping;
|
||||
}
|
||||
if pt.starts_with(b"fil ") {
|
||||
return Kind::File;
|
||||
}
|
||||
if pt.len() >= 4
|
||||
&& pt[0].is_ascii_lowercase()
|
||||
&& pt[1].is_ascii_lowercase()
|
||||
|
|
|
|||
Loading…
Reference in a new issue