summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-07-23 20:27:58 +0200
committerStefan Metzmacher <metze@samba.org>2012-07-24 18:44:04 +0200
commited726281b3dc32c6e31b81dd1fb76b0568687623 (patch)
tree4856d16e71ad9d5f2b34c573a9b5b5b40a182a2a
parent552dda970c6b665a36cf2af56142eb1456883528 (diff)
downloadsamba-ed726281b3dc32c6e31b81dd1fb76b0568687623.tar.gz
samba-ed726281b3dc32c6e31b81dd1fb76b0568687623.tar.bz2
samba-ed726281b3dc32c6e31b81dd1fb76b0568687623.zip
s3:libsmb: use a smbXcli_tcon instead of uint16_t cli_state->smb1.tid
metze
-rw-r--r--source3/include/client.h2
-rw-r--r--source3/libsmb/clientgen.c12
2 files changed, 9 insertions, 5 deletions
diff --git a/source3/include/client.h b/source3/include/client.h
index b6e62a3d92..9617c2a376 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -103,8 +103,8 @@ struct cli_state {
struct {
uint16_t pid;
uint16_t vc_num;
- uint16_t tid;
struct smbXcli_session *session;
+ struct smbXcli_tcon *tcon;
} smb1;
struct {
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 47cb0f30dd..ae0350b465 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -271,7 +271,11 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
cli->smb1.pid = (uint16_t)getpid();
cli->smb1.vc_num = cli->smb1.pid;
- cli->smb1.tid = UINT16_MAX;
+ cli->smb1.tcon = smbXcli_tcon_create(cli);
+ if (cli->smb1.tcon == NULL) {
+ goto error;
+ }
+ smb1cli_tcon_set_id(cli->smb1.tcon, UINT16_MAX);
cli->smb1.session = smbXcli_session_create(cli, cli->conn);
if (cli->smb1.session == NULL) {
goto error;
@@ -394,13 +398,13 @@ bool cli_state_has_tcon(struct cli_state *cli)
uint16_t cli_state_get_tid(struct cli_state *cli)
{
- return cli->smb1.tid;
+ return smb1cli_tcon_current_id(cli->smb1.tcon);
}
uint16_t cli_state_set_tid(struct cli_state *cli, uint16_t tid)
{
- uint16_t ret = cli->smb1.tid;
- cli->smb1.tid = tid;
+ uint16_t ret = smb1cli_tcon_current_id(cli->smb1.tcon);
+ smb1cli_tcon_set_id(cli->smb1.tcon, tid);
return ret;
}