Skip to content

Instantly share code, notes, and snippets.

@frsyuki
Created April 21, 2010 16:26
Show Gist options
  • Save frsyuki/374052 to your computer and use it in GitHub Desktop.
Save frsyuki/374052 to your computer and use it in GitHub Desktop.
diff --git a/src/gate/memproto/memtext.c b/src/gate/memproto/memtext.c
index 9c2b1da..89dec2c 100644
--- a/src/gate/memproto/memtext.c
+++ b/src/gate/memproto/memtext.c
@@ -85,13 +85,13 @@ static const unsigned char _memtext_key_offsets[] = {
111, 112, 113, 114, 115, 119, 120, 121,
122, 123, 127, 131, 132, 136, 138, 139,
140, 141, 142, 143, 144, 145, 146, 150,
- 151, 152, 154, 158, 162, 163, 167, 168,
- 169, 170, 171, 172, 173, 174, 175, 176,
- 177, 178, 179, 180, 181, 182, 183, 184,
- 185, 186, 187, 188, 189, 190, 191, 192,
- 193, 195, 196, 197, 198, 199, 200, 201,
- 203, 204, 207, 210, 211, 212, 213, 214,
- 223
+ 151, 152, 154, 158, 162, 166, 167, 169,
+ 170, 171, 172, 173, 174, 175, 176, 177,
+ 178, 179, 180, 181, 182, 183, 184, 185,
+ 186, 187, 188, 189, 190, 191, 192, 193,
+ 194, 195, 197, 198, 199, 200, 201, 202,
+ 203, 205, 206, 209, 212, 213, 214, 215,
+ 216, 225
};
static const char _memtext_trans_keys[] = {
@@ -115,14 +115,15 @@ static const char _memtext_trans_keys[] = {
13, 32, 110, 111, 114, 101, 112, 108,
121, 13, 13, 32, 48, 57, 101, 116,
32, 115, 0, 10, 13, 32, 0, 10,
- 13, 32, 10, 0, 10, 13, 32, 32,
- 110, 99, 114, 114, 101, 112, 101, 110,
- 100, 101, 112, 108, 97, 99, 101, 101,
- 116, 101, 114, 115, 105, 111, 110, 13,
- 10, 13, 110, 111, 114, 101, 112, 108,
- 121, 13, 32, 13, 32, 48, 57, 32,
- 48, 57, 112, 101, 110, 100, 97, 99,
- 100, 103, 105, 112, 114, 115, 118, 0
+ 13, 32, 0, 10, 13, 32, 10, 13,
+ 32, 32, 110, 99, 114, 114, 101, 112,
+ 101, 110, 100, 101, 112, 108, 97, 99,
+ 101, 101, 116, 101, 114, 115, 105, 111,
+ 110, 13, 10, 13, 110, 111, 114, 101,
+ 112, 108, 121, 13, 32, 13, 32, 48,
+ 57, 32, 48, 57, 112, 101, 110, 100,
+ 97, 99, 100, 103, 105, 112, 114, 115,
+ 118, 0
};
static const char _memtext_single_lengths[] = {
@@ -136,13 +137,13 @@ static const char _memtext_single_lengths[] = {
1, 1, 1, 1, 2, 1, 1, 1,
1, 4, 4, 1, 2, 2, 1, 1,
1, 1, 1, 1, 1, 1, 2, 1,
- 1, 2, 4, 4, 1, 4, 1, 1,
+ 1, 2, 4, 4, 4, 1, 2, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
- 2, 1, 1, 1, 1, 1, 1, 2,
- 1, 1, 1, 1, 1, 1, 1, 9,
- 0
+ 1, 2, 1, 1, 1, 1, 1, 1,
+ 2, 1, 1, 1, 1, 1, 1, 1,
+ 9, 0
};
static const char _memtext_range_lengths[] = {
@@ -161,8 +162,8 @@ static const char _memtext_range_lengths[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 0, 0, 0, 0, 0,
- 0
+ 0, 0, 1, 1, 0, 0, 0, 0,
+ 0, 0
};
static const short _memtext_index_offsets[] = {
@@ -176,13 +177,13 @@ static const short _memtext_index_offsets[] = {
153, 155, 157, 159, 161, 165, 167, 169,
171, 173, 178, 183, 185, 189, 192, 194,
196, 198, 200, 202, 204, 206, 208, 212,
- 214, 216, 219, 224, 229, 231, 236, 238,
- 240, 242, 244, 246, 248, 250, 252, 254,
- 256, 258, 260, 262, 264, 266, 268, 270,
- 272, 274, 276, 278, 280, 282, 284, 286,
- 288, 291, 293, 295, 297, 299, 301, 303,
- 306, 308, 311, 314, 316, 318, 320, 322,
- 332
+ 214, 216, 219, 224, 229, 234, 236, 239,
+ 241, 243, 245, 247, 249, 251, 253, 255,
+ 257, 259, 261, 263, 265, 267, 269, 271,
+ 273, 275, 277, 279, 281, 283, 285, 287,
+ 289, 291, 294, 296, 298, 300, 302, 304,
+ 306, 309, 311, 314, 317, 319, 321, 323,
+ 325, 335
};
static const unsigned char _memtext_indicies[] = {
@@ -214,43 +215,44 @@ static const unsigned char _memtext_indicies[] = {
102, 1, 103, 1, 104, 1, 105, 1,
97, 98, 106, 1, 107, 1, 108, 1,
109, 110, 1, 1, 1, 1, 1, 111,
- 1, 1, 113, 114, 112, 115, 1, 1,
- 1, 117, 1, 116, 109, 1, 118, 1,
- 119, 1, 120, 1, 121, 1, 122, 1,
- 123, 1, 124, 1, 125, 1, 126, 1,
- 127, 1, 128, 1, 129, 1, 130, 1,
- 131, 1, 132, 1, 133, 1, 134, 1,
- 135, 1, 136, 1, 137, 1, 138, 1,
- 139, 1, 140, 1, 141, 1, 142, 1,
- 143, 144, 1, 145, 1, 146, 1, 147,
- 1, 148, 1, 149, 1, 150, 1, 151,
- 152, 1, 143, 1, 22, 153, 1, 19,
- 154, 1, 155, 1, 156, 1, 157, 1,
- 158, 1, 0, 2, 3, 4, 5, 6,
- 7, 8, 9, 1, 159, 0
+ 1, 1, 1, 113, 112, 1, 1, 115,
+ 116, 114, 117, 1, 115, 116, 1, 109,
+ 1, 118, 1, 119, 1, 120, 1, 121,
+ 1, 122, 1, 123, 1, 124, 1, 125,
+ 1, 126, 1, 127, 1, 128, 1, 129,
+ 1, 130, 1, 131, 1, 132, 1, 133,
+ 1, 134, 1, 135, 1, 136, 1, 137,
+ 1, 138, 1, 139, 1, 140, 1, 141,
+ 1, 142, 1, 143, 144, 1, 145, 1,
+ 146, 1, 147, 1, 148, 1, 149, 1,
+ 150, 1, 151, 152, 1, 143, 1, 22,
+ 153, 1, 19, 154, 1, 155, 1, 156,
+ 1, 157, 1, 158, 1, 0, 2, 3,
+ 4, 5, 6, 7, 8, 9, 1, 159,
+ 0
};
static const unsigned char _memtext_trans_targs[] = {
- 2, 0, 16, 43, 79, 87, 90, 96,
- 102, 104, 3, 123, 4, 5, 6, 6,
- 7, 8, 122, 9, 10, 121, 11, 12,
- 13, 112, 12, 14, 15, 127, 17, 18,
+ 2, 0, 16, 43, 79, 88, 91, 97,
+ 103, 105, 3, 124, 4, 5, 6, 6,
+ 7, 8, 123, 9, 10, 122, 11, 12,
+ 13, 113, 12, 14, 15, 128, 17, 18,
19, 20, 20, 21, 22, 42, 23, 24,
41, 25, 26, 27, 26, 28, 40, 29,
- 32, 30, 31, 127, 33, 34, 35, 36,
+ 32, 30, 31, 128, 33, 34, 35, 36,
37, 38, 39, 29, 40, 41, 42, 44,
45, 61, 46, 47, 48, 48, 49, 50,
- 60, 51, 52, 127, 53, 54, 55, 56,
+ 60, 51, 52, 128, 53, 54, 55, 56,
57, 58, 59, 51, 60, 62, 63, 64,
- 65, 66, 66, 67, 68, 127, 69, 78,
+ 65, 66, 66, 67, 68, 128, 69, 78,
71, 67, 70, 72, 73, 74, 75, 76,
- 77, 67, 78, 80, 81, 82, 86, 83,
- 83, 84, 85, 127, 83, 84, 88, 89,
- 46, 91, 92, 93, 94, 95, 4, 97,
- 98, 99, 100, 101, 4, 103, 4, 105,
- 106, 107, 108, 109, 110, 111, 127, 13,
- 113, 114, 115, 116, 117, 118, 119, 13,
- 120, 121, 122, 124, 125, 126, 4, 128
+ 77, 67, 78, 80, 81, 82, 87, 83,
+ 83, 84, 83, 85, 86, 128, 89, 90,
+ 46, 92, 93, 94, 95, 96, 4, 98,
+ 99, 100, 101, 102, 4, 104, 4, 106,
+ 107, 108, 109, 110, 111, 112, 128, 13,
+ 114, 115, 116, 117, 118, 119, 120, 13,
+ 121, 122, 123, 125, 126, 127, 4, 129
};
static const char _memtext_trans_actions[] = {
@@ -268,7 +270,7 @@ static const char _memtext_trans_actions[] = {
0, 3, 0, 5, 5, 59, 11, 11,
0, 13, 13, 0, 0, 0, 0, 0,
0, 19, 0, 0, 29, 0, 31, 3,
- 0, 5, 5, 53, 65, 0, 0, 0,
+ 0, 5, 65, 0, 0, 53, 0, 0,
47, 0, 0, 0, 0, 0, 41, 0,
0, 0, 0, 0, 37, 0, 33, 0,
0, 0, 0, 0, 51, 0, 63, 0,
@@ -277,11 +279,11 @@ static const char _memtext_trans_actions[] = {
};
static const int memtext_start = 1;
-static const int memtext_first_final = 127;
+static const int memtext_first_final = 128;
static const int memtext_error = 0;
static const int memtext_en_main = 1;
-static const int memtext_en_data = 128;
+static const int memtext_en_data = 129;
#line 310 "memproto/memtext.rl"
@@ -291,7 +293,7 @@ void memtext_init(memtext_parser* ctx, memtext_callback* callback, void* user)
int cs = 0;
int top = 0;
-#line 295 "memproto/memtext.c.tmp"
+#line 297 "memproto/memtext.c.tmp"
{
cs = memtext_start;
top = 0;
@@ -327,7 +329,7 @@ int memtext_execute(memtext_parser* ctx, const char* data, size_t len, size_t* o
//printf("\n");
-#line 331 "memproto/memtext.c.tmp"
+#line 333 "memproto/memtext.c.tmp"
{
int _klen;
unsigned int _trans;
@@ -489,7 +491,7 @@ _match:
{
MARK(data_pos, p+1);
ctx->data_count = ctx->bytes;
- {stack[top++] = cs; cs = 128; goto _again;}
+ {stack[top++] = cs; cs = 129; goto _again;}
}
break;
case 14:
@@ -652,7 +654,7 @@ _match:
} else { goto convert_error; }
}
break;
-#line 656 "memproto/memtext.c.tmp"
+#line 658 "memproto/memtext.c.tmp"
}
}
diff --git a/src/gate/memproto/memtext.rl b/src/gate/memproto/memtext.rl
index 6fdd1ae..1c0a19b 100644
--- a/src/gate/memproto/memtext.rl
+++ b/src/gate/memproto/memtext.rl
@@ -256,7 +256,7 @@
other_command = ('version') @cmd_version;
retrieval = retrieval_command ' ' key (' ' key >incr_key)*
- ' '? # workaraound for libmemcached
+ ' '+ # workaraound for libmemcached and memcached client for java
'\r\n';
storage = storage_command ' ' key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment