/// is a special file tx that we look up by file_handle instead of XID
pub is_file_tx: bool,
+ pub is_file_closed: bool,
/// file transactions are unidirectional in the sense that they track
/// a single file on one direction
pub file_tx_direction: u8, // STREAM_TOCLIENT or STREAM_TOSERVER
response_done: false,
nfs_version:0,
is_file_tx: false,
+ is_file_closed: false,
file_tx_direction: 0,
file_handle:Vec::new(),
type_data: None,
{
let fh = file_handle.to_vec();
for tx in &mut self.transactions {
- if tx.is_file_tx &&
+ if tx.is_file_tx && !tx.is_file_closed &&
direction == tx.file_tx_direction &&
tx.file_handle == fh
{
tdf.file_last_xid = r.hdr.xid;
tx.is_last = true;
tx.response_done = true;
+ tx.is_file_closed = true;
}
true
} else {
tdf.file_last_xid = r.hdr.xid;
tx.is_last = true;
tx.request_done = true;
+ tx.is_file_closed = true;
}
}
}
if tdf.file_tracker.is_done() {
if direction == STREAM_TOCLIENT {
tx.response_done = true;
+ tx.is_file_closed = true;
SCLogDebug!("TX {} response is done now that the file track is ready", tx.id);
} else {
tx.request_done = true;
+ tx.is_file_closed = true;
SCLogDebug!("TX {} request is done now that the file track is ready", tx.id);
}
}
tdf.file_last_xid = r.hdr.xid;
tx.is_last = true;
tx.request_done = true;
+ tx.is_file_closed = true;
}
}
}
self.ts_chunk_left = w.write_len as u32 - file_data_len as u32;
}
+ fn close_v4<'b>(&mut self, r: &RpcPacket<'b>, fh: &'b[u8])
+ {
+ self.commit_v4(r, fh)
+ }
+
fn commit_v4<'b>(&mut self, r: &RpcPacket<'b>, fh: &'b[u8])
{
SCLogDebug!("COMMIT, closing shop");
tdf.file_last_xid = r.hdr.xid;
tx.is_last = true;
tx.request_done = true;
+ tx.is_file_closed = true;
}
}
}
}
&Nfs4RequestContent::Close(ref _rd) => {
SCLogDebug!("CLOSEv4: {:?}", _rd);
+ if let Some(fh) = last_putfh {
+ self.close_v4(r, fh);
+ }
}
&Nfs4RequestContent::Create(ref rd) => {
SCLogDebug!("CREATEv4: {:?}", rd);