[svn] commit: r38 - in /experiments/graff-ccapi: msgq/msgq.c protocol.txt ruby/lib/cc.rb

BIND 10 source code commits bind10-changes at lists.isc.org
Sat Sep 26 03:09:23 UTC 2009


Author: mgraff
Date: Sat Sep 26 03:09:23 2009
New Revision: 38

Log:
remove debugging, the basic protocol has been re-invented.

Modified:
    experiments/graff-ccapi/msgq/msgq.c
    experiments/graff-ccapi/protocol.txt
    experiments/graff-ccapi/ruby/lib/cc.rb

Modified: experiments/graff-ccapi/msgq/msgq.c
==============================================================================
--- experiments/graff-ccapi/msgq/msgq.c (original)
+++ experiments/graff-ccapi/msgq/msgq.c Sat Sep 26 03:09:23 2009
@@ -36,7 +36,7 @@
 #include "cc.h"
 
 #if !defined(MAXHOSTNAMELEN)
-#define MAXHOSTNAMELEN 64
+#define MAXHOSTNAMELEN 256
 #endif
 
 /*
@@ -54,7 +54,7 @@
  * Each block of items has this many per allocation block.  This helps
  * reduce the number of allocations we perform.
  */
-#define BUNDLE_SIZE 8
+#define BUNDLE_SIZE 16
 
 /*
  * Size of internal hash tables, and the hash init value.  The former can
@@ -181,7 +181,7 @@
 void process_packet(connection_t *);
 
 static void
-hexdump(const char *c, size_t len)
+hexdump(const unsigned char *c, size_t len)
 {
 	int count = 0;
 
@@ -505,9 +505,7 @@
 					continue;
 				con_enqueue(slcon, mb);
 				sendcnt++;
-				printf("To is NULL\n");
 			} else {
-				printf("To is %.*s\n", tlen, to);
 				if (slcon->lnamelen == tlen
 				    && slcon->lhash == lhash
 				    && memcmp(slcon->lname, to, tlen) == 0) {
@@ -519,8 +517,6 @@
 		sl = ISC_LIST_NEXT(sl, link);
 	}
 
-	printf("Sent message to %d destinations\n", sendcnt);
-
 	return (sendcnt);
 }
 
@@ -546,7 +542,6 @@
 	 * First, send it to those specifically listening on this instance
 	 */
 	if (ilen > 0) {
-		printf("SENDING instance specific messages\n");
 		sub = sub_find(group, glen, instance, ilen, NULL, NULL);
 		if (sub != NULL)
 			send_messages(sub, con, mb, to, tlen);
@@ -556,7 +551,6 @@
 	/*
 	 * And now to wildcard subscribers
 	 */
-	printf("SENDING instance * messages\n");
 	sub = sub_find(group, glen, NULL, 0, NULL, NULL);
 	if (sub != NULL)
 		send_messages(sub, con, mb, to, tlen);
@@ -661,9 +655,7 @@
 {
 	msgq_t *mq;
 
-	con_log(con, LOG_NOTICE, "sending mb %p (refcnt %d)", mb, mb->ref);
-
-	hexdump(mb->r.base, mb->r.length);
+	con_log(con, LOG_DEBUG, "sending mb %p (refcnt %d)", mb, mb->ref);
 
 	if (con->out_pending + mb->r.length > SEND_MAXBUF) {
 		con_log(con, LOG_DEBUG,

Modified: experiments/graff-ccapi/protocol.txt
==============================================================================
--- experiments/graff-ccapi/protocol.txt (original)
+++ experiments/graff-ccapi/protocol.txt Sat Sep 26 03:09:23 2009
@@ -183,7 +183,7 @@
 
     Tag      Description
     -------  ----------------------------------------
-    data     Sender-supplied data
+    msg      Sender-supplied data
     from     sender's identity
     group    Group name this message is being sent to
     instance Instance in this group
@@ -221,8 +221,12 @@
 
 When sending a message:
 
-"data" is the sender supplied data.  It is encoded as per its type.
+"msg" is the sender supplied data.  It is encoded as per its type.
 It is a required field, but may be the NULL type if not needed.
+In OpenReg, this was another wire format message, stored as an
+ITEM_DATA.  This was done to make it easy to decode the routing
+information without having to decode arbitrary application-supplied
+data, but rather treat this application data as an opaque blob.
 
 "from" is a DATA element, and its value is a UTF-8 encoded sender
 identity.  It MUST be the "local name" supplied by the message

Modified: experiments/graff-ccapi/ruby/lib/cc.rb
==============================================================================
--- experiments/graff-ccapi/ruby/lib/cc.rb (original)
+++ experiments/graff-ccapi/ruby/lib/cc.rb Sat Sep 26 03:09:23 2009
@@ -58,7 +58,7 @@
                :group => "test",
                :instance => "foo",
                :seq => "1",
-               :data => { :one => :two },
+               :msg => CC::Message.to_wire({ :one => :two }),
              })
   puts cc.recvmsg.inspect
   sleep 10




More information about the bind10-changes mailing list