fix: clipboard cm ipc data, raw bytes (#8930)
* fix: clipboard cm ipc data, raw bytes Signed-off-by: fufesou <linlong1266@gmail.com> * Remove useless check Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
5e7d4fd2d6
commit
6eea425280
@ -150,14 +150,8 @@ impl Handler {
|
|||||||
Ok(Ok(mut data)) => {
|
Ok(Ok(mut data)) => {
|
||||||
for c in &mut contents {
|
for c in &mut contents {
|
||||||
if c.next_raw {
|
if c.next_raw {
|
||||||
if c.content_len <= data.len() {
|
// No need to check the length because sum(content_len) == data.len().
|
||||||
c.content =
|
c.content = data.split_to(c.content_len).into();
|
||||||
data.split_off(c.content_len).into();
|
|
||||||
} else {
|
|
||||||
// Reconnect the next time to avoid the next raw data mismatch.
|
|
||||||
self.stream = None;
|
|
||||||
bail!("failed to get raw clipboard data: invalid size");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user