2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00

require utf8 strings

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@312 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Michael Graff
2009-11-20 14:04:52 +00:00
parent bc5d12940d
commit 7a5fb2613c
2 changed files with 16 additions and 15 deletions

View File

@@ -27,10 +27,11 @@
* Item types and data lengths. * Item types and data lengths.
*/ */
#define ITEM_UNDEFINED 0x00 #define ITEM_UNDEFINED 0x00
#define ITEM_DATA 0x01 #define ITEM_BLOB 0x01
#define ITEM_HASH 0x02 #define ITEM_HASH 0x02
#define ITEM_LIST 0x03 #define ITEM_LIST 0x03
#define ITEM_NULL 0x04 #define ITEM_NULL 0x04
#define ITEM_UTF8 0x08
#define ITEM_MASK 0x0f #define ITEM_MASK 0x0f
#define LENGTH_32 0x00 #define LENGTH_32 0x00

View File

@@ -392,9 +392,9 @@ handle_subscribe(connection_t *con, msgbuf_t *msgb, ccsearch_t *c)
return; return;
} }
if (group->type != ITEM_DATA if (group->type != ITEM_UTF8
|| instance->type != ITEM_DATA || instance->type != ITEM_UTF8
|| subtype->type != ITEM_DATA) { || subtype->type != ITEM_UTF8) {
con_log(con, LOG_NOTICE, con_log(con, LOG_NOTICE,
"Bad subscribe, incorrect data types"); "Bad subscribe, incorrect data types");
return; return;
@@ -421,8 +421,8 @@ handle_unsubscribe(connection_t *con, msgbuf_t *msgb, ccsearch_t *c)
return; return;
} }
if (group->type != ITEM_DATA if (group->type != ITEM_UTF8
|| instance->type != ITEM_DATA) { || instance->type != ITEM_UTF8) {
con_log(con, LOG_NOTICE, con_log(con, LOG_NOTICE,
"Bad subscribe, incorrect data types"); "Bad subscribe, incorrect data types");
return; return;
@@ -450,13 +450,13 @@ handle_send(connection_t *con, msgbuf_t *msgb, ccsearch_t *c)
return; return;
} }
if (group->type != ITEM_DATA if (group->type != ITEM_UTF8
|| instance->type != ITEM_DATA) { || instance->type != ITEM_UTF8) {
con_log(con, LOG_NOTICE, "Bad send, incorrect data types"); con_log(con, LOG_NOTICE, "Bad send, incorrect data types");
return; return;
} }
if (to->type != ITEM_DATA) { if (to->type != ITEM_UTF8) {
con_log(con, LOG_NOTICE, "Bad send, incorrect data types"); con_log(con, LOG_NOTICE, "Bad send, incorrect data types");
return; return;
} }
@@ -566,8 +566,8 @@ handle_lname(connection_t *con, msgbuf_t *msgb, ccsearch_t *c)
isc_buffer_t b; isc_buffer_t b;
ccmsg_init(&msg, buf, sizeof(buf)); ccmsg_init(&msg, buf, sizeof(buf));
ccmsg_add(&msg, ITEM_DATA, "lname", 5, con->lname, con->lnamelen); ccmsg_add(&msg, ITEM_UTF8, "lname", 5, con->lname, con->lnamelen);
ccmsg_add(&msg, ITEM_DATA, "type", 4, "getlname", 8); ccmsg_add(&msg, ITEM_UTF8, "type", 4, "getlname", 8);
len = ccmsg_render(&msg); len = ccmsg_render(&msg);
mb = msgbuf_create(mctx, len + 4); mb = msgbuf_create(mctx, len + 4);
@@ -625,13 +625,13 @@ process_packet(connection_t *con)
c = cc_findtag(cc, "type", 4); 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); 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); 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); 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); handle_unsubscribe(con, mb, cc);
} }
} }