Permalink
Browse files

Skip stats call when configuration lacks servers.

  • Loading branch information...
1 parent e60e02e commit 37e46ecd52e3cae1d9815a25a75883707a6f57c8 @tricky tricky committed May 2, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 php_memcached.c
View
@@ -1849,6 +1849,11 @@ PHP_METHOD(Memcached, getStats)
MEMC_METHOD_FETCH_OBJECT;
+ if (memcached_server_count(m_obj->memc) == 0) {
+ array_init(return_value);
+ return;
+ }
+
stats = memcached_stat(m_obj->memc, NULL, &status);
php_memc_handle_error(i_obj, status TSRMLS_CC);
if (stats == NULL) {

0 comments on commit 37e46ec

Please sign in to comment.