summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-05-27 18:28:56 +0200
committerStefan Metzmacher <metze@samba.org>2009-06-03 17:54:38 +0200
commit72f8328820a542167caba198dae23835f3c40a45 (patch)
tree81a5118bba32281661f81af5156a2d029dfe1581
parenta02265cdc4ea359979f89af99f58fb0720d7c464 (diff)
downloadsamba-72f8328820a542167caba198dae23835f3c40a45.tar.gz
samba-72f8328820a542167caba198dae23835f3c40a45.tar.bz2
samba-72f8328820a542167caba198dae23835f3c40a45.zip
s3:smbd: add a lazy mode for conn_new() and conn_free() for SMB2
metze
-rw-r--r--source3/smbd/conn.c15
1 files changed, 15 insertions, 0 deletions
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);