Implement SMB Durable Handles (Phase 1): Persistent FileId + reconnect + expiration + cleanup
This commit is contained in:
41
vendor/smb-server/src/backend.rs
vendored
41
vendor/smb-server/src/backend.rs
vendored
@@ -236,3 +236,44 @@ impl ShareBackend for NotSupportedBackend {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Null handle for testing purposes.
|
||||
pub struct NullHandle;
|
||||
|
||||
#[async_trait]
|
||||
impl Handle for NullHandle {
|
||||
async fn read(&self, _offset: u64, _len: u32) -> SmbResult<bytes::Bytes> {
|
||||
Err(SmbError::NotSupported)
|
||||
}
|
||||
async fn write(&self, _offset: u64, _data: &[u8]) -> SmbResult<u32> {
|
||||
Err(SmbError::NotSupported)
|
||||
}
|
||||
async fn flush(&self) -> SmbResult<()> {
|
||||
Err(SmbError::NotSupported)
|
||||
}
|
||||
async fn stat(&self) -> SmbResult<FileInfo> {
|
||||
Ok(FileInfo {
|
||||
name: String::new(),
|
||||
end_of_file: 0,
|
||||
allocation_size: 0,
|
||||
creation_time: 0,
|
||||
last_access_time: 0,
|
||||
last_write_time: 0,
|
||||
change_time: 0,
|
||||
is_directory: false,
|
||||
file_index: 0,
|
||||
})
|
||||
}
|
||||
async fn set_times(&self, _times: FileTimes) -> SmbResult<()> {
|
||||
Err(SmbError::NotSupported)
|
||||
}
|
||||
async fn truncate(&self, _len: u64) -> SmbResult<()> {
|
||||
Err(SmbError::NotSupported)
|
||||
}
|
||||
async fn list_dir(&self, _pattern: Option<&str>) -> SmbResult<Vec<DirEntry>> {
|
||||
Err(SmbError::NotSupported)
|
||||
}
|
||||
async fn close(self: Box<Self>) -> SmbResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user