{
rc= MEMCACHED_PARSE_ERROR;
(void)last_token;
- (void)last_token_str;
if (error_arg)
{
- memcached_set_parser_error(*memc, MEMCACHED_AT, "Error occured while parsing: %s", error_arg);
+ memcached_set_parser_error(*memc, MEMCACHED_AT, "%s", error_arg);
return;
}
- memcached_set_parser_error(*memc, MEMCACHED_AT, "Error occured while parsing: %s", memcached_strerror(NULL, MEMCACHED_PARSE_ERROR));
+ if (last_token_str)
+ {
+ memcached_set_parser_error(*memc, MEMCACHED_AT, "%s", last_token_str);
+ return;
+ }
+
+ memcached_set_parser_error(*memc, MEMCACHED_AT, "unknown parsing error");
}
void Context::error(const char *error_arg, yytokentype last_token, const char *last_token_str)
return _hostname;
}
+bool Context::set_hash(memcached_hash_t hash)
+{
+ if (_has_hash)
+ {
+ return false;
+ }
+
+ if ((memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, hash)) != MEMCACHED_SUCCESS)
+ {
+ return false;
+ }
+
+ return _has_hash= true;
+}