projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge in additional for last disconnected server.
[awesomized/libmemcached]
/
libmemcached
/
options
/
parser.yy
diff --git
a/libmemcached/options/parser.yy
b/libmemcached/options/parser.yy
index e7fb84ed972b09c02299fa1e197cdab50b84142a..6a7bd9b9f7378d3c011a00e61265db5fbfa8f98c 100644
(file)
--- a/
libmemcached/options/parser.yy
+++ b/
libmemcached/options/parser.yy
@@
-135,19
+135,21
@@
inline void config_error(Context *context, yyscan_t *scanner, const char *error)
%token <number> FLOAT
%token <number> NUMBER
%token <number> FLOAT
%token <number> NUMBER
-%token PORT
-%token WEIGHT_START
+%token
<number>
PORT
+%token
<number>
WEIGHT_START
%token <server> IPADDRESS
%token <server> HOSTNAME
%token <string> STRING
%token <string> QUOTED_STRING
%token <string> FILE_PATH
%token <server> IPADDRESS
%token <server> HOSTNAME
%token <string> STRING
%token <string> QUOTED_STRING
%token <string> FILE_PATH
-%type <string> string
-%type <distribution> distribution
-%type <hash> hash
%type <behavior> behavior_boolean
%type <behavior> behavior_number
%type <behavior> behavior_boolean
%type <behavior> behavior_number
+%type <distribution> distribution
+%type <hash> hash
+%type <number> optional_port
+%type <number> optional_weight
+%type <string> string
%%
%%
@@
-194,7
+196,7
@@
statement:
expression:
SERVER HOSTNAME optional_port optional_weight
{
expression:
SERVER HOSTNAME optional_port optional_weight
{
- if (
(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $2.port, $2.weight)) != MEMCACHED_SUCCESS
)
+ if (
memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $3, $4))
)
{
parser_abort(context, NULL);
}
{
parser_abort(context, NULL);
}
@@
-202,7
+204,7
@@
expression:
}
| SERVER IPADDRESS optional_port optional_weight
{
}
| SERVER IPADDRESS optional_port optional_weight
{
- if (
(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $2.port, $2.weight)) != MEMCACHED_SUCCESS
)
+ if (
memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $3, $4))
)
{
parser_abort(context, NULL);
}
{
parser_abort(context, NULL);
}
@@
-378,13
+380,13
@@
behavior_boolean:
optional_port:
optional_port:
- { }
+ {
$$= MEMCACHED_DEFAULT_PORT;
}
| PORT
{ };
;
optional_weight:
| PORT
{ };
;
optional_weight:
- { }
+ {
$$= 1;
}
| WEIGHT_START
{ }
;
| WEIGHT_START
{ }
;