diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-11-05 01:14:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:29 -0500 |
commit | 80eef3ea6647a9f8600466b2b468d38bd2eb0664 (patch) | |
tree | a2fd3a82ae58ce98746001762954197a106376e0 /source4/smb_server | |
parent | 96ffc6d945e9318f749796e63a76e6b52a289daa (diff) | |
download | samba-80eef3ea6647a9f8600466b2b468d38bd2eb0664.tar.gz samba-80eef3ea6647a9f8600466b2b468d38bd2eb0664.tar.bz2 samba-80eef3ea6647a9f8600466b2b468d38bd2eb0664.zip |
r3539: much nicer async open delay code.
The previous code didn't handle the case where the file got renamed or
deleted while waiting for the sharing violation delay. To handle this
we need to make the 2nd open a full open call, including the name
resolve call etc. Luckily this simplifies the logic.
I also expanded the RAW-MUX test to include the case where we do
open/open/open/close/close, with the 3rd open async, and that open
gets retried after both the first close and the 2nd close, with the
first retry failing and the 2nd retry working. The tests the "async
reply after a async reply" logic in pvfs_open().
(This used to be commit eded2ad9c91f5ba587ef4f7f5f5a6dceb4b51ff3)
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/smb_server.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index 3c17abe6fb..24d1c7eeb6 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -66,7 +66,7 @@ static void construct_reply(struct smbsrv_request *req); receive a SMB request header from the wire, forming a request_context from the result ****************************************************************************/ -static NTSTATUS receive_smb_request(struct smbsrv_connection *smb_conn) +static NTSTATUS receive_smb_request(struct smbsrv_connection *smb_conn, struct timeval t) { NTSTATUS status; ssize_t len; @@ -138,7 +138,7 @@ static NTSTATUS receive_smb_request(struct smbsrv_connection *smb_conn) } /* we have a full packet */ - GetTimeOfDay(&req->request_time); + req->request_time = t; req->chained_fnum = -1; req->in.allocated = req->in.size; req->in.hdr = req->in.buffer + NBT_HDR_SIZE; @@ -721,7 +721,7 @@ static void smbsrv_recv(struct server_connection *conn, struct timeval t, uint16 DEBUG(10,("smbsrv_recv\n")); - status = receive_smb_request(smb_conn); + status = receive_smb_request(smb_conn, t); if (NT_STATUS_IS_ERR(status)) { conn->event.fde->flags = 0; smbsrv_terminate_connection(smb_conn, nt_errstr(status)); @@ -808,7 +808,7 @@ void smbd_process_async(struct smbsrv_connection *smb_conn) { NTSTATUS status; - status = receive_smb_request(smb_conn); + status = receive_smb_request(smb_conn, timeval_current()); if (NT_STATUS_IS_ERR(status)) { smbsrv_terminate_connection(smb_conn, nt_errstr(status)); } |