X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Foptions%2Fparser.cc;h=7a075a8245dd89d65f8af4f6d491d9b0956ebe5d;hb=88036261374c676448be69d158777c9c379c7d6a;hp=2c1d5ac92a846f60910d63cf09799ea677800f5c;hpb=1591feaed3f710d48f76a6fc8a3a52242ab34fd9;p=m6w6%2Flibmemcached diff --git a/libmemcached/options/parser.cc b/libmemcached/options/parser.cc index 2c1d5ac9..7a075a82 100644 --- a/libmemcached/options/parser.cc +++ b/libmemcached/options/parser.cc @@ -82,30 +82,28 @@ #include +#include #include -#include #include #include -#include -#include #pragma GCC diagnostic ignored "-Wold-style-cast" #include int conf_lex(YYSTYPE* lvalp, void* scanner); -#define parser_abort(A, B) do { parser::abort_func((A), (B)); YYABORT; } while (0) +#define parser_abort(A, B) do { (A)->abort((B)); YYABORT; } while (0) inline void config_error(Context *context, yyscan_t *scanner, const char *error) { if (not context->end()) - parser::abort_func(context, error); + context->abort(error); } /* Line 189 of yacc.c */ -#line 109 "libmemcached/options/parser.cc" +#line 107 "libmemcached/options/parser.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -145,60 +143,61 @@ inline void config_error(Context *context, yyscan_t *scanner, const char *error) SERVERS_OPTION = 268, UNKNOWN_OPTION = 269, UNKNOWN = 270, - AUTO_EJECT_HOSTS = 271, - BINARY_PROTOCOL = 272, - BUFFER_REQUESTS = 273, - CONNECT_TIMEOUT = 274, - DISTRIBUTION = 275, - HASH = 276, - HASH_WITH_PREFIX_KEY = 277, - IO_BYTES_WATERMARK = 278, - IO_KEY_PREFETCH = 279, - IO_MSG_WATERMARK = 280, - KETAMA_HASH = 281, - KETAMA_WEIGHTED = 282, - NOREPLY = 283, - NUMBER_OF_REPLICAS = 284, - POLL_TIMEOUT = 285, - RANDOMIZE_REPLICA_READ = 286, - RCV_TIMEOUT = 287, + BINARY_PROTOCOL = 271, + BUFFER_REQUESTS = 272, + CONNECT_TIMEOUT = 273, + DISTRIBUTION = 274, + HASH = 275, + HASH_WITH_NAMESPACE = 276, + IO_BYTES_WATERMARK = 277, + IO_KEY_PREFETCH = 278, + IO_MSG_WATERMARK = 279, + KETAMA_HASH = 280, + KETAMA_WEIGHTED = 281, + NOREPLY = 282, + NUMBER_OF_REPLICAS = 283, + POLL_TIMEOUT = 284, + RANDOMIZE_REPLICA_READ = 285, + RCV_TIMEOUT = 286, + REMOVE_FAILED_SERVERS = 287, RETRY_TIMEOUT = 288, - SERVER_FAILURE_LIMIT = 289, - SND_TIMEOUT = 290, - SOCKET_RECV_SIZE = 291, - SOCKET_SEND_SIZE = 292, - SORT_HOSTS = 293, - SUPPORT_CAS = 294, - _TCP_NODELAY = 295, - _TCP_KEEPALIVE = 296, - _TCP_KEEPIDLE = 297, - USER_DATA = 298, - USE_UDP = 299, - VERIFY_KEY = 300, - PREFIX_KEY = 301, - MD5 = 302, - CRC = 303, - FNV1_64 = 304, - FNV1A_64 = 305, - FNV1_32 = 306, - FNV1A_32 = 307, - HSIEH = 308, - MURMUR = 309, - JENKINS = 310, - CONSISTENT = 311, - MODULA = 312, - RANDOM = 313, - TRUE = 314, - FALSE = 315, - NUMBER = 316, + SND_TIMEOUT = 289, + SOCKET_RECV_SIZE = 290, + SOCKET_SEND_SIZE = 291, + SORT_HOSTS = 292, + SUPPORT_CAS = 293, + USER_DATA = 294, + USE_UDP = 295, + VERIFY_KEY = 296, + _TCP_KEEPALIVE = 297, + _TCP_KEEPIDLE = 298, + _TCP_NODELAY = 299, + NAMESPACE = 300, + POOL_MIN = 301, + POOL_MAX = 302, + MD5 = 303, + CRC = 304, + FNV1_64 = 305, + FNV1A_64 = 306, + FNV1_32 = 307, + FNV1A_32 = 308, + HSIEH = 309, + MURMUR = 310, + JENKINS = 311, + CONSISTENT = 312, + MODULA = 313, + RANDOM = 314, + TRUE = 315, + FALSE = 316, FLOAT = 317, - HOSTNAME = 318, - HOSTNAME_WITH_PORT = 319, - IPADDRESS = 320, - IPADDRESS_WITH_PORT = 321, - STRING = 322, - QUOTED_STRING = 323, - FILE_PATH = 324 + NUMBER = 318, + PORT = 319, + WEIGHT_START = 320, + IPADDRESS = 321, + HOSTNAME = 322, + STRING = 323, + QUOTED_STRING = 324, + FILE_PATH = 325 }; #endif @@ -215,7 +214,7 @@ inline void config_error(Context *context, yyscan_t *scanner, const char *error) /* Line 264 of yacc.c */ -#line 219 "libmemcached/options/parser.cc" +#line 218 "libmemcached/options/parser.cc" #ifdef short # undef short @@ -428,22 +427,22 @@ union yyalloc #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 74 +#define YYFINAL 69 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 72 +#define YYLAST 73 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 73 +#define YYNTOKENS 74 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 12 /* YYNRULES -- Number of rules. */ -#define YYNRULES 69 +#define YYNRULES 66 /* YYNRULES -- Number of states. */ -#define YYNSTATES 85 +#define YYNSTATES 82 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 324 +#define YYMAXUTOK 325 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -454,10 +453,10 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 72, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 61, 2, 2, 2, 2, 2, + 2, 2, 73, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 62, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 62, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 63, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -482,8 +481,8 @@ static const yytype_uint8 yytranslate[] = 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 63, 64, 65, 66, - 67, 68, 69, 70, 71 + 55, 56, 57, 58, 59, 60, 61, 64, 65, 66, + 67, 68, 69, 70, 71, 72 }; #if YYDEBUG @@ -492,45 +491,45 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 9, 11, 13, 15, 17, 19, - 21, 23, 27, 30, 33, 36, 38, 41, 44, 49, - 52, 55, 57, 59, 61, 63, 65, 67, 69, 71, - 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, - 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, - 113, 117, 120, 122, 124, 127, 129, 131, 133, 135, - 137, 139, 141, 143, 145, 147, 149, 151, 153, 155 + 21, 23, 27, 32, 37, 40, 43, 46, 48, 51, + 54, 59, 62, 65, 67, 69, 71, 73, 75, 77, + 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 118, 120, 121, 123, 125, 127, 129, 131, 133, 135, + 137, 139, 141, 143, 145, 147, 149 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 74, 0, -1, 75, -1, 74, 72, 75, -1, 76, + 75, 0, -1, 76, -1, 75, 73, 76, -1, 77, -1, 3, -1, 10, -1, 4, -1, 5, -1, 6, - -1, 7, -1, 8, 72, 83, -1, 11, 81, -1, - 13, 80, -1, 9, 83, -1, 77, -1, 46, 83, - -1, 20, 84, -1, 20, 84, 61, 82, -1, 21, - 82, -1, 78, 63, -1, 79, -1, 43, -1, 19, - -1, 25, -1, 23, -1, 24, -1, 29, -1, 30, - -1, 32, -1, 33, -1, 34, -1, 35, -1, 36, - -1, 37, -1, 16, -1, 17, -1, 18, -1, 22, - -1, 27, -1, 28, -1, 31, -1, 38, -1, 39, - -1, 40, -1, 41, -1, 42, -1, 44, -1, 45, - -1, 81, -1, 80, 61, 81, -1, 66, 63, -1, - 65, -1, 69, -1, 68, 63, -1, 67, -1, 47, - -1, 48, -1, 49, -1, 50, -1, 51, -1, 52, - -1, 53, -1, 54, -1, 55, -1, 69, -1, 70, - -1, 56, -1, 57, -1, 58, -1 + -1, 7, -1, 8, 73, 84, -1, 11, 69, 81, + 82, -1, 11, 68, 81, 82, -1, 9, 84, -1, + 46, 65, -1, 47, 65, -1, 78, -1, 45, 84, + -1, 19, 85, -1, 19, 85, 62, 83, -1, 20, + 83, -1, 79, 65, -1, 80, -1, 39, -1, 32, + -1, 18, -1, 24, -1, 22, -1, 23, -1, 28, + -1, 29, -1, 31, -1, 33, -1, 34, -1, 35, + -1, 36, -1, 16, -1, 17, -1, 21, -1, 27, + -1, 30, -1, 37, -1, 38, -1, 44, -1, 42, + -1, 43, -1, 40, -1, 41, -1, -1, 66, -1, + -1, 67, -1, 48, -1, 49, -1, 50, -1, 51, + -1, 52, -1, 53, -1, 54, -1, 55, -1, 56, + -1, 70, -1, 71, -1, 57, -1, 58, -1, 59, + -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 156, 156, 157, 161, 163, 165, 167, 172, 177, - 181, 185, 196, 203, 206, 210, 214, 221, 228, 239, - 246, 253, 260, 266, 270, 274, 278, 282, 286, 290, - 294, 298, 302, 306, 310, 317, 321, 325, 329, 333, - 337, 341, 345, 349, 353, 357, 361, 365, 369, 376, - 383, 393, 399, 405, 411, 417, 426, 430, 434, 438, - 442, 446, 450, 454, 458, 465, 469, 477, 481, 485 + 181, 185, 196, 204, 212, 216, 220, 224, 228, 235, + 242, 253, 260, 267, 274, 280, 284, 288, 292, 296, + 300, 304, 308, 312, 316, 320, 324, 331, 335, 339, + 343, 347, 351, 355, 359, 363, 367, 371, 375, 382, + 383, 388, 389, 394, 398, 402, 406, 410, 414, 418, + 422, 426, 433, 437, 445, 449, 453 }; #endif @@ -542,21 +541,21 @@ static const char *const yytname[] = "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET", "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER", "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN", - "AUTO_EJECT_HOSTS", "BINARY_PROTOCOL", "BUFFER_REQUESTS", - "CONNECT_TIMEOUT", "DISTRIBUTION", "HASH", "HASH_WITH_PREFIX_KEY", - "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH", "IO_MSG_WATERMARK", - "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY", "NUMBER_OF_REPLICAS", - "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ", "RCV_TIMEOUT", "RETRY_TIMEOUT", - "SERVER_FAILURE_LIMIT", "SND_TIMEOUT", "SOCKET_RECV_SIZE", - "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS", "_TCP_NODELAY", - "_TCP_KEEPALIVE", "_TCP_KEEPIDLE", "USER_DATA", "USE_UDP", "VERIFY_KEY", - "PREFIX_KEY", "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", - "HSIEH", "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", - "FALSE", "','", "'='", "NUMBER", "FLOAT", "HOSTNAME", - "HOSTNAME_WITH_PORT", "IPADDRESS", "IPADDRESS_WITH_PORT", "STRING", - "QUOTED_STRING", "FILE_PATH", "' '", "$accept", "begin", "statement", - "expression", "behaviors", "behavior_number", "behavior_boolean", - "server_list", "server", "hash", "string", "distribution", 0 + "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION", + "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH", + "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY", + "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ", + "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT", + "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS", + "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE", + "_TCP_NODELAY", "NAMESPACE", "POOL_MIN", "POOL_MAX", "MD5", "CRC", + "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR", + "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','", + "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS", + "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept", + "begin", "statement", "expression", "behaviors", "behavior_number", + "behavior_boolean", "optional_port", "optional_weight", "hash", "string", + "distribution", 0 }; #endif @@ -571,33 +570,33 @@ static const yytype_uint16 yytoknum[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 44, 61, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 32 + 315, 316, 44, 61, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 32 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 73, 74, 74, 75, 75, 75, 75, 75, 75, - 75, 75, 76, 76, 76, 76, 77, 77, 77, 77, - 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, + 0, 74, 75, 75, 76, 76, 76, 76, 76, 76, + 76, 76, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, - 80, 81, 81, 81, 81, 81, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 83, 83, 84, 84, 84 + 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, + 81, 82, 82, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 84, 84, 85, 85, 85 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 3, 1, 1, 1, 1, 1, 1, - 1, 3, 2, 2, 2, 1, 2, 2, 4, 2, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 4, 4, 2, 2, 2, 1, 2, 2, + 4, 2, 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, 1, 1, - 3, 2, 1, 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, 0, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -606,44 +605,44 @@ static const yytype_uint8 yyr2[] = static const yytype_uint8 yydefact[] = { 0, 5, 7, 8, 9, 10, 0, 0, 6, 0, - 0, 35, 36, 37, 23, 0, 0, 38, 25, 26, - 24, 39, 40, 27, 28, 41, 29, 30, 31, 32, - 33, 34, 42, 43, 44, 45, 46, 22, 47, 48, - 0, 0, 2, 4, 15, 0, 21, 0, 65, 66, - 14, 52, 0, 55, 0, 53, 12, 13, 49, 67, - 68, 69, 17, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 19, 16, 1, 0, 20, 11, 51, 54, - 0, 0, 3, 50, 18 + 37, 38, 26, 0, 0, 39, 28, 29, 27, 40, + 30, 31, 41, 32, 25, 33, 34, 35, 36, 42, + 43, 24, 47, 48, 45, 46, 44, 0, 0, 0, + 0, 2, 4, 17, 0, 23, 0, 62, 63, 14, + 49, 49, 64, 65, 66, 19, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 21, 18, 15, 16, 1, + 0, 22, 11, 50, 51, 51, 0, 3, 52, 13, + 12, 20 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 41, 42, 43, 44, 45, 46, 57, 56, 72, - 50, 62 + -1, 40, 41, 42, 43, 44, 45, 74, 79, 65, + 49, 55 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -62 +#define YYPACT_NINF -61 static const yytype_int8 yypact[] = { - -1, -62, -62, -62, -62, -62, -61, -56, -62, -7, - -7, -62, -62, -62, -62, 9, 1, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -56, 0, -62, -62, -62, -38, -62, -56, -62, -62, - -62, -62, -17, -62, -16, -62, -62, 2, -62, -62, - -62, -62, 7, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -1, -62, -62, -62, -62, - -7, 1, -62, -62, -62 + -2, -61, -61, -61, -61, -61, -60, -23, -61, -45, + -61, -61, -61, -47, 8, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -23, -16, -15, + 0, -61, -61, -61, -14, -61, -23, -61, -61, -61, + -13, -13, -61, -61, -61, -10, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -2, -61, -61, -61, -1, -1, 8, -61, -61, -61, + -61, -61 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -62, -62, -6, -62, -62, -62, -62, -62, -9, -11, - 17, -62 + -61, -61, -5, -61, -61, -61, -61, 3, -8, -7, + 9, -61 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -653,26 +652,26 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 74, 58, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 47, 10, 48, 49, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 76, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 78, 79, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 73, 51, 52, - 53, 54, 55, 80, 77, 59, 60, 61, 81, 82, - 84, 83, 75 + 69, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 52, 53, 54, 46, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 50, 51, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 66, 47, 48, 67, + 68, 71, 76, 73, 75, 72, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 77, 78, 80, 0, 81, + 0, 0, 0, 70 }; -static const yytype_uint8 yycheck[] = +static const yytype_int8 yycheck[] = { - 0, 10, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 72, 13, 69, 70, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 63, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 63, 63, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 40, 65, 66, - 67, 68, 69, 61, 47, 56, 57, 58, 61, 75, - 81, 80, 72 + 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 57, 58, 59, 73, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 68, 69, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 37, 70, 71, 65, + 65, 65, 62, 66, 51, 46, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 70, 67, 75, -1, 76, + -1, -1, -1, 73 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -680,14 +679,14 @@ static const yytype_uint8 yycheck[] = static const yytype_uint8 yystos[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 74, 75, 76, 77, 78, 79, 72, 69, 70, - 83, 65, 66, 67, 68, 69, 81, 80, 81, 56, - 57, 58, 84, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 82, 83, 0, 72, 63, 83, 63, 63, - 61, 61, 75, 81, 82 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 75, 76, 77, 78, 79, 80, 73, 70, 71, 84, + 68, 69, 57, 58, 59, 85, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 83, 84, 65, 65, 0, + 73, 65, 84, 66, 81, 81, 62, 76, 67, 82, + 82, 83 }; #define yyerrok (yyerrstatus = 0) @@ -1594,52 +1593,52 @@ yyreduce: /* Line 1464 of yacc.c */ #line 197 "libmemcached/options/parser.yy" - { - if ((context->rc= memcached_server_add_parsed(context->memc, (yyvsp[(2) - (2)].server).c_str, (yyvsp[(2) - (2)].server).length, (yyvsp[(2) - (2)].server).port, 0)) != MEMCACHED_SUCCESS) + { + if ((context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(2) - (4)].server).port, (yyvsp[(2) - (4)].server).weight)) != MEMCACHED_SUCCESS) { parser_abort(context, NULL); } + context->unset_server(); ;} break; case 13: /* Line 1464 of yacc.c */ -#line 204 "libmemcached/options/parser.yy" +#line 205 "libmemcached/options/parser.yy" { + if ((context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(2) - (4)].server).port, (yyvsp[(2) - (4)].server).weight)) != MEMCACHED_SUCCESS) + { + parser_abort(context, NULL); + } + context->unset_server(); ;} break; case 14: /* Line 1464 of yacc.c */ -#line 207 "libmemcached/options/parser.yy" +#line 213 "libmemcached/options/parser.yy" { memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).length); ;} break; - case 16: + case 15: /* Line 1464 of yacc.c */ -#line 215 "libmemcached/options/parser.yy" +#line 217 "libmemcached/options/parser.yy" { - if ((context->rc= memcached_set_prefix_key(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).length)) != MEMCACHED_SUCCESS) - { - parser_abort(context, NULL);; - } + context->memc->configure.initial_pool_size= (yyvsp[(2) - (2)].number); ;} break; - case 17: + case 16: /* Line 1464 of yacc.c */ -#line 222 "libmemcached/options/parser.yy" +#line 221 "libmemcached/options/parser.yy" { - if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS) - { - parser_abort(context, NULL);; - } + context->memc->configure.max_pool_size= (yyvsp[(2) - (2)].number); ;} break; @@ -1648,11 +1647,7 @@ yyreduce: /* Line 1464 of yacc.c */ #line 229 "libmemcached/options/parser.yy" { - if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS) - { - parser_abort(context, NULL);; - } - if ((context->rc= memcached_behavior_set_distribution_hash(context->memc, (yyvsp[(4) - (4)].hash))) != MEMCACHED_SUCCESS) + if ((context->rc= memcached_set_prefix_key(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).length)) != MEMCACHED_SUCCESS) { parser_abort(context, NULL);; } @@ -1662,11 +1657,11 @@ yyreduce: case 19: /* Line 1464 of yacc.c */ -#line 240 "libmemcached/options/parser.yy" +#line 236 "libmemcached/options/parser.yy" { - if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, (yyvsp[(2) - (2)].hash))) != MEMCACHED_SUCCESS) + if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS) { - parser_abort(context, NULL);; + parser_abort(context, NULL);; } ;} break; @@ -1674,9 +1669,13 @@ yyreduce: case 20: /* Line 1464 of yacc.c */ -#line 247 "libmemcached/options/parser.yy" +#line 243 "libmemcached/options/parser.yy" { - if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS) + if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS) + { + parser_abort(context, NULL);; + } + if ((context->rc= memcached_behavior_set_distribution_hash(context->memc, (yyvsp[(4) - (4)].hash))) != MEMCACHED_SUCCESS) { parser_abort(context, NULL);; } @@ -1688,9 +1687,9 @@ yyreduce: /* Line 1464 of yacc.c */ #line 254 "libmemcached/options/parser.yy" { - if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS) + if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, (yyvsp[(2) - (2)].hash))) != MEMCACHED_SUCCESS) { - parser_abort(context, NULL);; + parser_abort(context, NULL);; } ;} break; @@ -1700,166 +1699,172 @@ yyreduce: /* Line 1464 of yacc.c */ #line 261 "libmemcached/options/parser.yy" { + if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS) + { + parser_abort(context, NULL);; + } ;} break; case 23: /* Line 1464 of yacc.c */ -#line 267 "libmemcached/options/parser.yy" +#line 268 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT; + if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS) + { + parser_abort(context, NULL);; + } ;} break; case 24: /* Line 1464 of yacc.c */ -#line 271 "libmemcached/options/parser.yy" +#line 275 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK; ;} break; case 25: /* Line 1464 of yacc.c */ -#line 275 "libmemcached/options/parser.yy" +#line 281 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK; + (yyval.behavior)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS; ;} break; case 26: /* Line 1464 of yacc.c */ -#line 279 "libmemcached/options/parser.yy" +#line 285 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH; + (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT; ;} break; case 27: /* Line 1464 of yacc.c */ -#line 283 "libmemcached/options/parser.yy" +#line 289 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS; + (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK; ;} break; case 28: /* Line 1464 of yacc.c */ -#line 287 "libmemcached/options/parser.yy" +#line 293 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT; + (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK; ;} break; case 29: /* Line 1464 of yacc.c */ -#line 291 "libmemcached/options/parser.yy" +#line 297 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT; + (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH; ;} break; case 30: /* Line 1464 of yacc.c */ -#line 295 "libmemcached/options/parser.yy" +#line 301 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT; + (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS; ;} break; case 31: /* Line 1464 of yacc.c */ -#line 299 "libmemcached/options/parser.yy" +#line 305 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT; + (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT; ;} break; case 32: /* Line 1464 of yacc.c */ -#line 303 "libmemcached/options/parser.yy" +#line 309 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT; + (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT; ;} break; case 33: /* Line 1464 of yacc.c */ -#line 307 "libmemcached/options/parser.yy" +#line 313 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE; + (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT; ;} break; case 34: /* Line 1464 of yacc.c */ -#line 311 "libmemcached/options/parser.yy" +#line 317 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE; + (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT; ;} break; case 35: /* Line 1464 of yacc.c */ -#line 318 "libmemcached/options/parser.yy" +#line 321 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS; + (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE; ;} break; case 36: /* Line 1464 of yacc.c */ -#line 322 "libmemcached/options/parser.yy" +#line 325 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL; + (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE; ;} break; case 37: /* Line 1464 of yacc.c */ -#line 326 "libmemcached/options/parser.yy" +#line 332 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS; + (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL; ;} break; case 38: /* Line 1464 of yacc.c */ -#line 330 "libmemcached/options/parser.yy" +#line 336 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY; + (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS; ;} break; case 39: /* Line 1464 of yacc.c */ -#line 334 "libmemcached/options/parser.yy" +#line 340 "libmemcached/options/parser.yy" { - (yyval.behavior)= MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED; + (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY; ;} break; case 40: /* Line 1464 of yacc.c */ -#line 338 "libmemcached/options/parser.yy" +#line 344 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY; ;} @@ -1868,7 +1873,7 @@ yyreduce: case 41: /* Line 1464 of yacc.c */ -#line 342 "libmemcached/options/parser.yy" +#line 348 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ; ;} @@ -1877,7 +1882,7 @@ yyreduce: case 42: /* Line 1464 of yacc.c */ -#line 346 "libmemcached/options/parser.yy" +#line 352 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS; ;} @@ -1886,7 +1891,7 @@ yyreduce: case 43: /* Line 1464 of yacc.c */ -#line 350 "libmemcached/options/parser.yy" +#line 356 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS; ;} @@ -1895,7 +1900,7 @@ yyreduce: case 44: /* Line 1464 of yacc.c */ -#line 354 "libmemcached/options/parser.yy" +#line 360 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY; ;} @@ -1904,7 +1909,7 @@ yyreduce: case 45: /* Line 1464 of yacc.c */ -#line 358 "libmemcached/options/parser.yy" +#line 364 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE; ;} @@ -1913,7 +1918,7 @@ yyreduce: case 46: /* Line 1464 of yacc.c */ -#line 362 "libmemcached/options/parser.yy" +#line 368 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE; ;} @@ -1922,7 +1927,7 @@ yyreduce: case 47: /* Line 1464 of yacc.c */ -#line 366 "libmemcached/options/parser.yy" +#line 372 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP; ;} @@ -1931,7 +1936,7 @@ yyreduce: case 48: /* Line 1464 of yacc.c */ -#line 370 "libmemcached/options/parser.yy" +#line 376 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY; ;} @@ -1940,204 +1945,153 @@ yyreduce: case 49: /* Line 1464 of yacc.c */ -#line 377 "libmemcached/options/parser.yy" - { - if ((context->rc= memcached_server_add_parsed(context->memc, (yyvsp[(1) - (1)].server).c_str, (yyvsp[(1) - (1)].server).length, (yyvsp[(1) - (1)].server).port, 0)) != MEMCACHED_SUCCESS) - { - parser_abort(context, NULL);; - } - ;} +#line 382 "libmemcached/options/parser.yy" + { ;} break; case 50: /* Line 1464 of yacc.c */ #line 384 "libmemcached/options/parser.yy" - { - if ((context->rc= memcached_server_add_parsed(context->memc, (yyvsp[(3) - (3)].server).c_str, (yyvsp[(3) - (3)].server).length, (yyvsp[(3) - (3)].server).port, 0)) != MEMCACHED_SUCCESS) - { - parser_abort(context, NULL);; - } - ;} + { ;} break; case 51: /* Line 1464 of yacc.c */ -#line 394 "libmemcached/options/parser.yy" - { - (yyval.server).c_str= (yyvsp[(1) - (2)].string).c_str; - (yyval.server).length= (yyvsp[(1) - (2)].string).length -1; // -1 to remove : - (yyval.server).port= (yyvsp[(2) - (2)].number); - ;} +#line 388 "libmemcached/options/parser.yy" + { ;} break; case 52: /* Line 1464 of yacc.c */ -#line 400 "libmemcached/options/parser.yy" - { - (yyval.server).c_str= (yyvsp[(1) - (1)].string).c_str; - (yyval.server).length= (yyvsp[(1) - (1)].string).length; - (yyval.server).port= MEMCACHED_DEFAULT_PORT; - ;} +#line 390 "libmemcached/options/parser.yy" + { ;} break; case 53: /* Line 1464 of yacc.c */ -#line 406 "libmemcached/options/parser.yy" - { - (yyval.server).c_str= (yyvsp[(1) - (1)].string).c_str; - (yyval.server).length= (yyvsp[(1) - (1)].string).length; - (yyval.server).port= MEMCACHED_DEFAULT_PORT; - ;} - break; - - case 54: - -/* Line 1464 of yacc.c */ -#line 412 "libmemcached/options/parser.yy" - { - (yyval.server).c_str= (yyvsp[(1) - (2)].string).c_str; - (yyval.server).length= (yyvsp[(1) - (2)].string).length -1; // -1 to remove : - (yyval.server).port= (yyvsp[(2) - (2)].number); - ;} - break; - - case 55: - -/* Line 1464 of yacc.c */ -#line 418 "libmemcached/options/parser.yy" - { - (yyval.server).c_str= (yyvsp[(1) - (1)].string).c_str; - (yyval.server).length= (yyvsp[(1) - (1)].string).length; - (yyval.server).port= MEMCACHED_DEFAULT_PORT; - ;} - break; - - case 56: - -/* Line 1464 of yacc.c */ -#line 427 "libmemcached/options/parser.yy" +#line 395 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MD5; ;} break; - case 57: + case 54: /* Line 1464 of yacc.c */ -#line 431 "libmemcached/options/parser.yy" +#line 399 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_CRC; ;} break; - case 58: + case 55: /* Line 1464 of yacc.c */ -#line 435 "libmemcached/options/parser.yy" +#line 403 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_64; ;} break; - case 59: + case 56: /* Line 1464 of yacc.c */ -#line 439 "libmemcached/options/parser.yy" +#line 407 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_64; ;} break; - case 60: + case 57: /* Line 1464 of yacc.c */ -#line 443 "libmemcached/options/parser.yy" +#line 411 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_32; ;} break; - case 61: + case 58: /* Line 1464 of yacc.c */ -#line 447 "libmemcached/options/parser.yy" +#line 415 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_32; ;} break; - case 62: + case 59: /* Line 1464 of yacc.c */ -#line 451 "libmemcached/options/parser.yy" +#line 419 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_HSIEH; ;} break; - case 63: + case 60: /* Line 1464 of yacc.c */ -#line 455 "libmemcached/options/parser.yy" +#line 423 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MURMUR; ;} break; - case 64: + case 61: /* Line 1464 of yacc.c */ -#line 459 "libmemcached/options/parser.yy" +#line 427 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_JENKINS; ;} break; - case 65: + case 62: /* Line 1464 of yacc.c */ -#line 466 "libmemcached/options/parser.yy" +#line 434 "libmemcached/options/parser.yy" { (yyval.string)= (yyvsp[(1) - (1)].string); ;} break; - case 66: + case 63: /* Line 1464 of yacc.c */ -#line 470 "libmemcached/options/parser.yy" +#line 438 "libmemcached/options/parser.yy" { (yyval.string).c_str= (yyvsp[(1) - (1)].string).c_str +1; // +1 to move use passed the initial quote (yyval.string).length= (yyvsp[(1) - (1)].string).length -1; // -1 removes the end quote ;} break; - case 67: + case 64: /* Line 1464 of yacc.c */ -#line 478 "libmemcached/options/parser.yy" +#line 446 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT; ;} break; - case 68: + case 65: /* Line 1464 of yacc.c */ -#line 482 "libmemcached/options/parser.yy" +#line 450 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA; ;} break; - case 69: + case 66: /* Line 1464 of yacc.c */ -#line 486 "libmemcached/options/parser.yy" +#line 454 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM; ;} @@ -2146,7 +2100,7 @@ yyreduce: /* Line 1464 of yacc.c */ -#line 2150 "libmemcached/options/parser.cc" +#line 2104 "libmemcached/options/parser.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2358,7 +2312,7 @@ yyreturn: /* Line 1684 of yacc.c */ -#line 491 "libmemcached/options/parser.yy" +#line 459 "libmemcached/options/parser.yy" void Context::start()