summaryrefslogtreecommitdiff
path: root/source4/smb_server/handle.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-20 16:48:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:13 -0500
commit3cb64219e2cd492d25931f5442cbd484d6930950 (patch)
tree6dafd1f62deaab05aa4f2db5b7664e8864ff6024 /source4/smb_server/handle.c
parent35d6a53ff7b7b906d9a42bad5b7647a2abc6a3f6 (diff)
downloadsamba-3cb64219e2cd492d25931f5442cbd484d6930950.tar.gz
samba-3cb64219e2cd492d25931f5442cbd484d6930950.tar.bz2
samba-3cb64219e2cd492d25931f5442cbd484d6930950.zip
r15751: thanks to talloc_get_type() I noticed that I used smbsrv_request in the smb2srv code
metze (This used to be commit 6c304a1a5f5dc6b2d3774682303874444a59b07d)
Diffstat (limited to 'source4/smb_server/handle.c')
-rw-r--r--source4/smb_server/handle.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/source4/smb_server/handle.c b/source4/smb_server/handle.c
index c2fea9e91c..07b49bf79d 100644
--- a/source4/smb_server/handle.c
+++ b/source4/smb_server/handle.c
@@ -76,6 +76,12 @@ struct smbsrv_handle *smbsrv_smb_handle_find(struct smbsrv_tcon *smb_tcon,
return smbsrv_handle_find(&smb_tcon->handles, fnum, request_time);
}
+struct smbsrv_handle *smbsrv_smb2_handle_find(struct smbsrv_tcon *smb_tcon,
+ uint64_t hid, struct timeval request_time)
+{
+ return smbsrv_handle_find(&smb_tcon->handles, hid, request_time);
+}
+
/*
destroy a connection structure
*/
@@ -102,16 +108,19 @@ static int smbsrv_handle_destructor(void *ptr)
/*
find first available handle slot
*/
-struct smbsrv_handle *smbsrv_handle_new(struct smbsrv_request *req)
+struct smbsrv_handle *smbsrv_handle_new(struct smbsrv_session *session,
+ struct smbsrv_tcon *tcon,
+ TALLOC_CTX *mem_ctx,
+ struct timeval request_time)
{
- struct smbsrv_handles_context *handles_ctx = &req->tcon->handles;
+ struct smbsrv_handles_context *handles_ctx = &tcon->handles;
struct smbsrv_handle *handle;
int i;
- handle = talloc_zero(req, struct smbsrv_handle);
+ handle = talloc_zero(mem_ctx, struct smbsrv_handle);
if (!handle) return NULL;
- handle->tcon = req->tcon;
- handle->session = req->session;
+ handle->tcon = tcon;
+ handle->session = session;
i = idr_get_new_above(handles_ctx->idtree_hid, handle, 1, handles_ctx->idtree_limit);
if (i == -1) {
@@ -122,12 +131,12 @@ struct smbsrv_handle *smbsrv_handle_new(struct smbsrv_request *req)
handle->session_item.handle = handle;
DLIST_ADD(handles_ctx->list, handle);
- DLIST_ADD(handle->session->handles, &handle->session_item);
+ DLIST_ADD(session->handles, &handle->session_item);
talloc_set_destructor(handle, smbsrv_handle_destructor);
/* now fill in some statistics */
- handle->statistics.open_time = req->request_time;
- handle->statistics.last_use_time = req->request_time;
+ handle->statistics.open_time = request_time;
+ handle->statistics.last_use_time = request_time;
return handle;