- }
- else if (rc == MEMCACHED_END)
- {
- break;
- }
- else if (rc == MEMCACHED_SERVER_ERROR or rc == MEMCACHED_CLIENT_ERROR)
- {
- /* If we try to request stats cachedump for a slab class that is too big
- * the server will return an incorrect error message:
- * "MEMCACHED_SERVER_ERROR failed to allocate memory"
- * This isn't really a fatal error, so let's just skip it. I want to
- * fix the return value from the memcached server to a CLIENT_ERROR,
- * so let's add support for that as well right now.
- */
- rc= MEMCACHED_END;
- break;
- }
- else
- {
- goto error;
+ else if (response_rc == MEMCACHED_END)
+ {
+ // No additional items were found
+ exit_slab_loop= true;
+ break;
+ }
+ else if (response_rc == MEMCACHED_SERVER_ERROR or response_rc == MEMCACHED_CLIENT_ERROR)
+ {
+ /* If we try to request stats cachedump for a slab class that is too big
+ * the server will return an incorrect error message:
+ * "MEMCACHED_SERVER_ERROR failed to allocate memory"
+ * This isn't really a fatal error, so let's just skip it. I want to
+ * fix the return value from the memcached server to a CLIENT_ERROR,
+ * so let's add support for that as well right now.
+ */
+ exit_slab_loop= true;
+ break;
+ }
+ else
+ {
+ memcached_set_error(*instance, response_rc, MEMCACHED_AT);
+ exit_slab_loop= true;
+ break;
+ }