summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-08-12 14:50:09 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-12 18:06:04 +0200
commitc485df9530fda65fb1a2142f53c60638d2ca1923 (patch)
treeec6cdf534838e86dbe3ab2a0904c9dc73f01c598 /source3/libsmb
parent58003b5a77910ec54fd84f71a26e582af0f83e98 (diff)
downloadsamba-c485df9530fda65fb1a2142f53c60638d2ca1923.tar.gz
samba-c485df9530fda65fb1a2142f53c60638d2ca1923.tar.bz2
samba-c485df9530fda65fb1a2142f53c60638d2ca1923.zip
s3:libsmb: abstract the incoming dispatch function via a function pointer
This will allow handling of SMB2 in future. metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/async_smb.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index b3de5af50b..b07eee9e10 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -228,6 +228,9 @@ bool cli_smb_req_set_pending(struct tevent_req *req)
}
static void cli_smb_received(struct tevent_req *subreq);
+static NTSTATUS cli_state_dispatch_smb1(struct cli_state *cli,
+ TALLOC_CTX *frame,
+ uint8_t *inbuf);
static bool cli_state_receive_next(struct cli_state *cli)
{
@@ -246,6 +249,8 @@ static bool cli_state_receive_next(struct cli_state *cli)
req = cli->conn.pending[0];
state = tevent_req_data(req, struct cli_smb_state);
+ cli->conn.dispatch_incoming = cli_state_dispatch_smb1;
+
/*
* We're the first ones, add the read_smb request that waits for the
* answer from the server
@@ -579,10 +584,6 @@ static void cli_smb_sent(struct tevent_req *subreq)
}
}
-static NTSTATUS cli_state_dispatch_smb1(struct cli_state *cli,
- TALLOC_CTX *frame,
- uint8_t *inbuf);
-
static void cli_smb_received(struct tevent_req *subreq)
{
struct cli_state *cli = tevent_req_callback_data(
@@ -612,7 +613,7 @@ static void cli_smb_received(struct tevent_req *subreq)
return;
}
- status = cli_state_dispatch_smb1(cli, frame, inbuf);
+ status = cli->conn.dispatch_incoming(cli, frame, inbuf);
TALLOC_FREE(frame);
if (NT_STATUS_IS_OK(status)) {
/*