svn commit: samba r13317 - in branches/SAMBA_4_0/source: lib/messaging libnet

abartlet at samba.org abartlet at samba.org
Fri Feb 3 22:30:30 GMT 2006


Author: abartlet
Date: 2006-02-03 22:30:30 +0000 (Fri, 03 Feb 2006)
New Revision: 13317

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

Log:
Create a new function messaging_client_init() which can be used when
we don't have a server messaging context.  We should replace the
datagram messages with stream sockets in this case, so we don't have
to create a unique socket.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/messaging/irpc.h
   branches/SAMBA_4_0/source/lib/messaging/messaging.c
   branches/SAMBA_4_0/source/libnet/libnet_lookup.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/messaging/irpc.h
===================================================================
--- branches/SAMBA_4_0/source/lib/messaging/irpc.h	2006-02-03 22:19:41 UTC (rev 13316)
+++ branches/SAMBA_4_0/source/lib/messaging/irpc.h	2006-02-03 22:30:30 UTC (rev 13317)
@@ -86,6 +86,8 @@
 			void (*fn)(struct messaging_context *, void *, uint32_t, uint32_t, DATA_BLOB *));
 struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, 
 					 struct event_context *ev);
+struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, 
+					 struct event_context *ev);
 NTSTATUS messaging_send_ptr(struct messaging_context *msg, uint32_t server, 
 			    uint32_t msg_type, void *ptr);
 void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private);

Modified: branches/SAMBA_4_0/source/lib/messaging/messaging.c
===================================================================
--- branches/SAMBA_4_0/source/lib/messaging/messaging.c	2006-02-03 22:19:41 UTC (rev 13316)
+++ branches/SAMBA_4_0/source/lib/messaging/messaging.c	2006-02-03 22:30:30 UTC (rev 13317)
@@ -459,7 +459,14 @@
 	return msg;
 }
 
-
+/* 
+   A hack, for the short term until we get 'client only' messaging in place 
+*/
+struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, 
+						struct event_context *ev)
+{
+	return messaging_init(mem_ctx, random() % 0x10000000, ev);
+}
 /*
   a list of registered irpc server functions
 */

Modified: branches/SAMBA_4_0/source/libnet/libnet_lookup.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_lookup.c	2006-02-03 22:19:41 UTC (rev 13316)
+++ branches/SAMBA_4_0/source/libnet/libnet_lookup.c	2006-02-03 22:30:30 UTC (rev 13317)
@@ -167,7 +167,7 @@
 						TALLOC_CTX *mem_ctx,
 						struct libnet_LookupDCs *io)
 {
-	struct messaging_context *msg_ctx = messaging_init(mem_ctx, random() % 0x10000000, ctx->event_ctx);
+	struct messaging_context *msg_ctx = messaging_client_init(mem_ctx, ctx->event_ctx);
 	struct composite_context *c;
 	c = finddcs_send(mem_ctx,
 			 io->in.domain_name, 



More information about the samba-cvs mailing list