patch: fix dead lock in file transfer

Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
This commit is contained in:
ClSlaid
2023-10-20 22:27:39 +08:00
parent c529f8099d
commit db62a01224
5 changed files with 121 additions and 102 deletions

View File

@@ -119,19 +119,19 @@ lazy_static::lazy_static! {
impl ClipboardFile {
pub fn is_stopping_allowed(&self) -> bool {
match self {
matches!(
self,
ClipboardFile::MonitorReady
| ClipboardFile::FormatList { .. }
| ClipboardFile::FormatDataRequest { .. } => true,
_ => false,
}
| ClipboardFile::FormatList { .. }
| ClipboardFile::FormatDataRequest { .. }
)
}
pub fn is_stopping_allowed_from_peer(&self) -> bool {
match self {
ClipboardFile::MonitorReady | ClipboardFile::FormatList { .. } => true,
_ => false,
}
matches!(
self,
ClipboardFile::MonitorReady | ClipboardFile::FormatList { .. }
)
}
}