svn commit: samba r10769 - in branches/tmp/samba4-winsrepl: . source/smbd

metze at samba.org metze at samba.org
Thu Oct 6 14:45:07 GMT 2005


Author: metze
Date: 2005-10-06 14:45:06 +0000 (Thu, 06 Oct 2005)
New Revision: 10769

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10769

Log:
 r13393 at SERNOX (orig r10768):  metze | 2005-10-06 16:44:37 +0200
 add a function to create a stream_connection from an already
 existing socket connection, that's used for protocols
 which switch the client/server roles inside a session
 
 metze

Modified:
   branches/tmp/samba4-winsrepl/
   branches/tmp/samba4-winsrepl/source/smbd/service_stream.c


Changeset:

Property changes on: branches/tmp/samba4-winsrepl
___________________________________________________________________
Name: svk:merge
   - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10766
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11632
   + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10768
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11632

Modified: branches/tmp/samba4-winsrepl/source/smbd/service_stream.c
===================================================================
--- branches/tmp/samba4-winsrepl/source/smbd/service_stream.c	2005-10-06 14:44:37 UTC (rev 10768)
+++ branches/tmp/samba4-winsrepl/source/smbd/service_stream.c	2005-10-06 14:45:06 UTC (rev 10769)
@@ -78,7 +78,40 @@
 	}
 }
 
+/*
+  this creates a stream_connection from an already existing connection,
+  used for protocols, where a client connection needs to switched into
+  a server connection
+*/
+NTSTATUS stream_new_connection_merge(struct event_context *ev,
+				     const struct model_ops *model_ops,
+				     struct socket_context *sock,
+				     const struct stream_server_ops *stream_ops,
+				     struct messaging_context *msg_ctx,
+				     void *private_data,
+				     struct stream_connection **_srv_conn)
+{
+	struct stream_connection *srv_conn;
 
+	srv_conn = talloc_zero(ev, struct stream_connection);
+	NT_STATUS_HAVE_NO_MEMORY(srv_conn);
+
+	talloc_steal(srv_conn, sock);
+
+	srv_conn->private       = private_data;
+	srv_conn->model_ops     = model_ops;
+	srv_conn->socket	= sock;
+	srv_conn->server_id	= 0;
+	srv_conn->ops           = stream_ops;
+	srv_conn->msg_ctx	= msg_ctx;
+	srv_conn->event.ctx	= ev;
+	srv_conn->event.fde	= event_add_fd(ev, srv_conn, socket_get_fd(sock),
+					       EVENT_FD_READ, 
+					       stream_io_handler, srv_conn);
+	*_srv_conn = srv_conn;
+	return NT_STATUS_OK;
+}
+
 /*
   called when a new socket connection has been established. This is called in the process
   context of the new process (if appropriate)



More information about the samba-cvs mailing list