From 72f8328820a542167caba198dae23835f3c40a45 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 May 2009 18:28:56 +0200 Subject: s3:smbd: add a lazy mode for conn_new() and conn_free() for SMB2 metze --- source3/smbd/conn.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3') diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index 607329de77..af6e0919a4 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -94,6 +94,16 @@ connection_struct *conn_new(struct smbd_server_connection *sconn) int i; int find_offset = 1; + if (sconn->allow_smb2) { + if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) || + !(conn->params = TALLOC_P(conn, struct share_params))) { + DEBUG(0,("TALLOC_ZERO() failed!\n")); + TALLOC_FREE(conn); + return NULL; + } + return conn; + } + find_again: i = bitmap_find(sconn->smb1.tcons.bmap, find_offset); @@ -286,6 +296,11 @@ void conn_free_internal(connection_struct *conn) void conn_free(struct smbd_server_connection *sconn, connection_struct *conn) { + if (sconn->allow_smb2) { + conn_free_internal(conn); + return; + } + DLIST_REMOVE(sconn->smb1.tcons.Connections, conn); bitmap_clear(sconn->smb1.tcons.bmap, conn->cnum); -- cgit