3 memcached_return
memcached_flush(memcached_st
*ptr
, time_t expiration
)
8 char buffer
[MEMCACHED_DEFAULT_COMMAND_SIZE
];
9 LIBMEMCACHED_MEMCACHED_FLUSH_START();
11 unlikely (ptr
->number_of_hosts
== 0)
12 return MEMCACHED_NO_SERVERS
;
14 for (x
= 0; x
< ptr
->number_of_hosts
; x
++)
17 send_length
= snprintf(buffer
, MEMCACHED_DEFAULT_COMMAND_SIZE
,
18 "flush_all %llu\r\n", (unsigned long long)expiration
);
20 send_length
= snprintf(buffer
, MEMCACHED_DEFAULT_COMMAND_SIZE
,
23 rc
= memcached_do(&ptr
->hosts
[x
], buffer
, send_length
, 1);
25 if (rc
== MEMCACHED_SUCCESS
)
26 (void)memcached_response(&ptr
->hosts
[x
], buffer
, MEMCACHED_DEFAULT_COMMAND_SIZE
, NULL
);
29 LIBMEMCACHED_MEMCACHED_FLUSH_END();
30 return MEMCACHED_SUCCESS
;