2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
16 #include "libmemcached/common.h"
18 memcached_return_t
initialize_query(Memcached
*self
, bool increment_query_id
) {
20 return MEMCACHED_INVALID_ARGUMENTS
;
23 if (increment_query_id
) {
27 if (self
->state
.is_time_for_rebuild
) {
28 memcached_reset(self
);
31 if (memcached_server_count(self
) == 0) {
32 return memcached_set_error(*self
, MEMCACHED_NO_SERVERS
, MEMCACHED_AT
);
35 memcached_error_free(*self
);
36 memcached_result_reset(&self
->result
);
38 return MEMCACHED_SUCCESS
;
41 memcached_return_t
initialize_const_query(const Memcached
*self
) {
43 return MEMCACHED_INVALID_ARGUMENTS
;
46 if (memcached_server_count(self
) == 0) {
47 return MEMCACHED_NO_SERVERS
;
50 return MEMCACHED_SUCCESS
;