summaryrefslogtreecommitdiffstats
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/conn.c9
-rw-r--r--source3/smbd/globals.h4
-rw-r--r--source3/smbd/msdfs.c2
-rw-r--r--source3/smbd/smb2_tcon.c3
4 files changed, 11 insertions, 7 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index d12495bf788..b18231f44cb 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -33,7 +33,6 @@ init the conn structures
void conn_init(struct smbd_server_connection *sconn)
{
sconn->smb1.tcons.Connections = NULL;
- sconn->smb1.tcons.num_open = 0;
sconn->smb1.tcons.bmap = bitmap_talloc(sconn, BITMAP_BLOCK_SZ);
}
@@ -42,7 +41,7 @@ return the number of open connections
****************************************************************************/
int conn_num_open(struct smbd_server_connection *sconn)
{
- return sconn->smb1.tcons.num_open;
+ return sconn->num_tcons_open;
}
@@ -161,7 +160,7 @@ find_again:
bitmap_set(sconn->smb1.tcons.bmap, i);
- sconn->smb1.tcons.num_open++;
+ sconn->num_tcons_open++;
string_set(&conn->connectpath,"");
string_set(&conn->origpath,"");
@@ -329,8 +328,8 @@ void conn_free(connection_struct *conn)
bitmap_clear(conn->sconn->smb1.tcons.bmap, conn->cnum);
}
- SMB_ASSERT(conn->sconn->smb1.tcons.num_open > 0);
- conn->sconn->smb1.tcons.num_open--;
+ SMB_ASSERT(conn->sconn->num_tcons_open > 0);
+ conn->sconn->num_tcons_open--;
conn_free_internal(conn);
}
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index cbbb583ae9f..5037b6d6b5f 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -465,6 +465,9 @@ struct smbd_server_connection {
unsigned long file_gen_counter;
int first_file;
+ /* number of open connections (tcons) */
+ int num_tcons_open;
+
struct {
struct fd_event *fde;
@@ -531,7 +534,6 @@ struct smbd_server_connection {
connection_struct *Connections;
/* number of open connections */
struct bitmap *bmap;
- int num_open;
} tcons;
struct smb_signing_state *signing_state;
/* List to store partial SPNEGO auth fragments. */
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 481958c8ae8..c005a2f3ab5 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -256,7 +256,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
conn->params->service = snum;
conn->sconn = smbd_server_conn;
- conn->sconn->smb1.tcons.num_open += 1;
+ conn->sconn->num_tcons_open++;
if (server_info != NULL) {
conn->server_info = copy_serverinfo(conn, server_info);
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index 1cfb4ceaa61..203325e71a4 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -127,6 +127,8 @@ static int smbd_smb2_tcon_destructor(struct smbd_smb2_tcon *tcon)
idr_remove(tcon->session->tcons.idtree, tcon->tid);
DLIST_REMOVE(tcon->session->tcons.list, tcon);
+ SMB_ASSERT(tcon->session->sconn->num_tcons_open > 0);
+ tcon->session->sconn->num_tcons_open--;
if (tcon->compat_conn) {
set_current_service(tcon->compat_conn, 0, true);
@@ -214,6 +216,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
DLIST_ADD_END(req->session->tcons.list, tcon,
struct smbd_smb2_tcon *);
tcon->session = req->session;
+ tcon->session->sconn->num_tcons_open++;
talloc_set_destructor(tcon, smbd_smb2_tcon_destructor);
compat_conn = make_connection_snum(req->sconn,