[svn] commit: r312 - in /branches/parkinglot/src/bin/msgq: cc.h msgq.c

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Nov 20 14:04:52 UTC 2009


Author: mgraff
Date: Fri Nov 20 14:04:52 2009
New Revision: 312

Log:
require utf8 strings

Modified:
    branches/parkinglot/src/bin/msgq/cc.h
    branches/parkinglot/src/bin/msgq/msgq.c

Modified: branches/parkinglot/src/bin/msgq/cc.h
==============================================================================
--- branches/parkinglot/src/bin/msgq/cc.h (original)
+++ branches/parkinglot/src/bin/msgq/cc.h Fri Nov 20 14:04:52 2009
@@ -27,10 +27,11 @@
  * Item types and data lengths.
  */
 #define ITEM_UNDEFINED	0x00
-#define ITEM_DATA	0x01
+#define ITEM_BLOB	0x01
 #define ITEM_HASH	0x02
 #define ITEM_LIST	0x03
 #define ITEM_NULL	0x04
+#define ITEM_UTF8   0x08
 #define ITEM_MASK	0x0f
 
 #define LENGTH_32	0x00

Modified: branches/parkinglot/src/bin/msgq/msgq.c
==============================================================================
--- branches/parkinglot/src/bin/msgq/msgq.c (original)
+++ branches/parkinglot/src/bin/msgq/msgq.c Fri Nov 20 14:04:52 2009
@@ -392,9 +392,9 @@
 		return;
 	}
 
-	if (group->type != ITEM_DATA
-	    || instance->type != ITEM_DATA
-	    || subtype->type != ITEM_DATA) {
+	if (group->type != ITEM_UTF8
+	    || instance->type != ITEM_UTF8
+	    || subtype->type != ITEM_UTF8) {
 		con_log(con, LOG_NOTICE,
 			"Bad subscribe, incorrect data types");
 		return;
@@ -421,8 +421,8 @@
 		return;
 	}
 
-	if (group->type != ITEM_DATA
-	    || instance->type != ITEM_DATA) {
+	if (group->type != ITEM_UTF8
+	    || instance->type != ITEM_UTF8) {
 		con_log(con, LOG_NOTICE,
 			"Bad subscribe, incorrect data types");
 		return;
@@ -450,13 +450,13 @@
 		return;
 	}
 
-	if (group->type != ITEM_DATA
-	    || instance->type != ITEM_DATA) {
+	if (group->type != ITEM_UTF8
+	    || instance->type != ITEM_UTF8) {
 		con_log(con, LOG_NOTICE, "Bad send, incorrect data types");
 		return;
 	}
 
-	if (to->type != ITEM_DATA) {
+	if (to->type != ITEM_UTF8) {
 		con_log(con, LOG_NOTICE, "Bad send, incorrect data types");
 		return;
 	}
@@ -566,8 +566,8 @@
 	isc_buffer_t b;
 
 	ccmsg_init(&msg, buf, sizeof(buf));
-	ccmsg_add(&msg, ITEM_DATA, "lname", 5, con->lname, con->lnamelen);
-	ccmsg_add(&msg, ITEM_DATA, "type", 4, "getlname", 8);
+	ccmsg_add(&msg, ITEM_UTF8, "lname", 5, con->lname, con->lnamelen);
+	ccmsg_add(&msg, ITEM_UTF8, "type", 4, "getlname", 8);
 	len = ccmsg_render(&msg);
 
 	mb = msgbuf_create(mctx, len + 4);
@@ -625,13 +625,13 @@
 
 	c = cc_findtag(cc, "type", 4);
 
-	if (cc_matchdata(c, ITEM_DATA, "send", 4)) {
+	if (cc_matchdata(c, ITEM_UTF8, "send", 4)) {
 		handle_send(con, mb, cc);
-	} else if (cc_matchdata(c, ITEM_DATA, "getlname", 8)) {
+	} else if (cc_matchdata(c, ITEM_UTF8, "getlname", 8)) {
 		handle_lname(con, mb, cc);
-	} else if (cc_matchdata(c, ITEM_DATA, "subscribe", 9)) {
+	} else if (cc_matchdata(c, ITEM_UTF8, "subscribe", 9)) {
 		handle_subscribe(con, mb, cc);
-	} else if (cc_matchdata(c, ITEM_DATA, "unsubscribe", 9)) {
+	} else if (cc_matchdata(c, ITEM_UTF8, "unsubscribe", 9)) {
 		handle_unsubscribe(con, mb, cc);
 	}
 }




More information about the bind10-changes mailing list