Implement SMB Oplocks Phase 3+5
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

Phase 3: NotificationQueue
- Add notification_tx to Connection struct
- Modify writer.rs to use tokio::select! for response + notification
- Add write_to_bytes() to OplockBreakNotification
- Support server→client async messages

Phase 5: WRITE Handler oplock break
- Get path/share_access before write
- Trigger OplockManager.break_oplock()
- Send OPLOCK_BREAK_NOTIFICATION to affected clients
- Encode and send via notification channel

All 229 tests pass.
This commit is contained in:
Warren
2026-06-21 00:35:48 +08:00
parent be9fe72742
commit 2dd50e4cb6
5 changed files with 90 additions and 14 deletions

View File

@@ -33,6 +33,12 @@ impl OplockBreakNotification {
out.extend_from_slice(&c.into_inner());
Ok(())
}
/// Phase 3: Write to a new Vec (convenience method).
pub fn write_to_bytes(&self) -> Vec<u8> {
let mut buf = Vec::new();
self.write_to(&mut buf).expect("encode notification");
buf
}
}
/// SMB2_OPLOCK_BREAK_ACK (MS-SMB2 §2.2.24.1) — same wire shape as the