legit hostname.
std::string error_message;
error_message+= context->begin;
error_message+= " (";
- error_message+= memcached_strerror(NULL, context->rc);
+ if (context->rc == MEMCACHED_PARSE_ERROR and error)
+ {
+ error_message+= error;
+ }
+ else
+ {
+ error_message+= memcached_strerror(NULL, context->rc);
+ }
error_message+= ")";
memcached_set_error_string(context->memc, context->rc, error_message.c_str(), error_message.size());
%token <string> IPADDRESS_WITH_PORT
%token <string> STRING
%token <string> QUOTED_STRING
+%token <string> FILE_PATH
%type <server> server
%type <string> string
%%
begin:
- statement
- | statement ' ' statement
+ statement
+ | begin ' ' statement
;
statement:
{
yydebug= 0;
}
- | INCLUDE string
+ | INCLUDE FILE_PATH
{
+ std::cerr << "Got into INCLUDE" << std::endl;
if ((context->rc= memcached_parse_configure_file(context->memc, $2.c_str, $2.length)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);
"--PREFIX-KEY" { yyextra->begin= yytext; return PREFIX_KEY; }
"--PREFIX_KEY" { yyextra->begin= yytext; return PREFIX_KEY; }
-INCLUDE { yyextra->begin= yytext; return INCLUDE; }
+INCLUDE { yyextra->begin= yytext; std::cerr << "Found INCLUDE" << std::endl; return INCLUDE; }
RESET { yyextra->begin= yytext; return RESET; }
DEBUG { yyextra->begin= yytext; return DEBUG; }
SERVERS { yyextra->begin= yytext; return SERVERS; }
return HOSTNAME_WITH_PORT;
}
-[[:alnum:]]+"."[[:alpha:].]+ {
+[[:alnum:]]+"."[[:alpha:].]+[[:alnum:]] {
yylval->string.c_str = yytext;
yylval->string.length = yyleng;
return HOSTNAME;
{ ARRAY, make_scanner_string("-servers=localhost:11221,localhost:11222,localhost:11223,localhost:11224,localhost:11225"), scanner_string_null, NULL },
{ ARRAY, make_scanner_string("-- servers=a.example.com:81,localhost:82,b.example.com"), scanner_string_null, NULL },
{ ARRAY, make_scanner_string("--servers=localhost+80"), scanner_string_null, NULL},
+ { ARRAY, make_scanner_string("--servers=localhost.com."), scanner_string_null, NULL},
+ { ARRAY, make_scanner_string("--server=localhost.com."), scanner_string_null, NULL},
+ { ARRAY, make_scanner_string("--server=localhost.com.:80"), scanner_string_null, NULL},
{ NIL, scanner_string_null, scanner_string_null, NULL}
};