summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-12-13 13:18:47 +0100
committerStefan Metzmacher <metze@samba.org>2011-12-13 20:31:09 +0100
commit17ae2267e346920445ea67253f0a9d82fb3e0e35 (patch)
treebfe701f84f1a08fe3fea946256863e6ffea02cb5
parent90674f0fce81f3fea1d15a9c2588427dd5e4cd9c (diff)
downloadsamba-17ae2267e346920445ea67253f0a9d82fb3e0e35.tar.gz
samba-17ae2267e346920445ea67253f0a9d82fb3e0e35.tar.bz2
samba-17ae2267e346920445ea67253f0a9d82fb3e0e35.zip
s3:smbd/oplock: pass sconn as private_data to process_open_retry_message()
metze
-rw-r--r--source3/smbd/oplock.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 067681e0f9..3f515b576c 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -729,7 +729,13 @@ static void process_open_retry_message(struct messaging_context *msg_ctx,
DATA_BLOB *data)
{
struct share_mode_entry msg;
- struct smbd_server_connection *sconn;
+ struct smbd_server_connection *sconn =
+ talloc_get_type(private_data,
+ struct smbd_server_connection);
+
+ if (sconn == NULL) {
+ return;
+ }
if (data->data == NULL) {
DEBUG(0, ("Got NULL buffer\n"));
@@ -748,10 +754,7 @@ static void process_open_retry_message(struct messaging_context *msg_ctx,
server_id_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
(unsigned long long)msg.op_mid));
- sconn = msg_ctx_to_sconn(msg_ctx);
- if (sconn != NULL) {
- schedule_deferred_open_message_smb(sconn, msg.op_mid);
- }
+ schedule_deferred_open_message_smb(sconn, msg.op_mid);
}
/****************************************************************************
@@ -945,7 +948,7 @@ bool init_oplocks(struct smbd_server_connection *sconn)
process_oplock_break_response);
messaging_register(sconn->msg_ctx, sconn, MSG_SMB_KERNEL_BREAK,
process_kernel_oplock_break);
- messaging_register(sconn->msg_ctx, NULL, MSG_SMB_OPEN_RETRY,
+ messaging_register(sconn->msg_ctx, sconn, MSG_SMB_OPEN_RETRY,
process_open_retry_message);
if (lp_kernel_oplocks()) {