<commit_before>diff --git a/libmemcached/dump.cc b/libmemcached/dump.cc
index 8ddb2ee..cc53ec6 100644
--- a/libmemcached/dump.cc
+++ b/libmemcached/dump.cc
@@ -1,5 +1,5 @@
 /*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
+ *
  *  Libmemcached library
  *
  *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
@@ -46,14 +46,16 @@
 
 static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callback, void *context, uint32_t number_of_callbacks)
 {
-  /* MAX_NUMBER_OF_SLAB_CLASSES is defined to 200 in Memcached 1.4.10 */
+
+//`	if memc->server_info.version
+  /* MAX_NUMBER_OF_SLAB_CLASSES is defined as 200 for memcached versions up to 1.4.22 and redefined to 64 above that.*/
   for (uint32_t x= 0; x < 200; x++)
   {
     char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
     int buffer_length= snprintf(buffer, sizeof(buffer), "%u", x);
     if (size_t(buffer_length) >= sizeof(buffer) or buffer_length < 0)
     {
-      return memcached_set_error(*memc, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, 
+      return memcached_set_error(*memc, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
                                  memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)"));
     }
 
@@ -70,15 +72,23 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac
     {
       memcached_instance_st* instance= memcached_instance_fetch(memc, server_key);
 
-      memcached_return_t vdo_rc;
-      if (memcached_success((vdo_rc= memcached_vdo(instance, vector, 3, true))))
-      {
-        // We have sent the message to the server successfully
-      }
-      else
-      {
-        return vdo_rc;
-      }
+      // Starting with version 1.4.23 the slab size went from 200 to 63.
+
+      // Starting with version 1.4.23 the slab size went from 200 to 63.
+      if (x <= 63 ||
+       (instance->major_version == 1 && instance->minor_version == 4 && instance->micro_version < 23) ||
+       (instance->major_version == 1 && instance->minor_version < 4))
+			{
+				memcached_return_t vdo_rc;
+				if (memcached_success((vdo_rc= memcached_vdo(instance, vector, 3, true))))
+				{
+					// We have sent the message to the server successfully
+				}
+				else
+				{
+					return vdo_rc;
+				}
+			}
     }
 
     // Collect the returned items
@@ -86,50 +96,57 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac
     memcached_return_t read_ret= MEMCACHED_SUCCESS;
     while ((instance= memcached_io_get_readable_server(memc, read_ret)))
     {
-      memcached_return_t response_rc= memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
-      if (response_rc == MEMCACHED_ITEM)
-      {
-        char *string_ptr, *end_ptr;
-
-        string_ptr= buffer;
-        string_ptr+= 5; /* Move past ITEM */
-
-        for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++) {} ;
-
-        char *key= string_ptr;
-        key[(size_t)(end_ptr-string_ptr)]= 0;
-
-        for (uint32_t callback_counter= 0; callback_counter < number_of_callbacks; callback_counter++)
-        {
-          memcached_return_t callback_rc= (*callback[callback_counter])(memc, key, (size_t)(end_ptr-string_ptr), context);
-          if (callback_rc != MEMCACHED_SUCCESS)
-          {
-            // @todo build up a message for the error from the value
-            memcached_set_error(*instance, callback_rc, MEMCACHED_AT);
-            break;
-          }
-        }
-      }
-      else if (response_rc == MEMCACHED_END)
-      { 
-        // All items have been returned
-      }
-      else if (response_rc == MEMCACHED_SERVER_ERROR or response_rc == MEMCACHED_CLIENT_ERROR or response_rc == MEMCACHED_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.
-       */
-        assert(response_rc == MEMCACHED_SUCCESS); // Just fail
-        return response_rc;
-      }
-      else
+
+      // Starting with version 1.4.23 the slab size went from 200 to 63.
+      if (x <= 63 ||
+       (instance->major_version == 1 && instance->minor_version == 4 && instance->micro_version < 23) ||
+       (instance->major_version == 1 && instance->minor_version < 4))
       {
-        // IO error of some sort must have occurred
-        return response_rc;
+				memcached_return_t response_rc= memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
+				if (response_rc == MEMCACHED_ITEM)
+				{
+					char *string_ptr, *end_ptr;
+
+					string_ptr= buffer;
+					string_ptr+= 5; /* Move past ITEM */
+
+					for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++) {} ;
+
+					char *key= string_ptr;
+					key[(size_t)(end_ptr-string_ptr)]= 0;
+
+					for (uint32_t callback_counter= 0; callback_counter < number_of_callbacks; callback_counter++)
+					{
+						memcached_return_t callback_rc= (*callback[callback_counter])(memc, key, (size_t)(end_ptr-string_ptr), context);
+						if (callback_rc != MEMCACHED_SUCCESS)
+						{
+							// @todo build up a message for the error from the value
+							memcached_set_error(*instance, callback_rc, MEMCACHED_AT);
+							break;
+						}
+					}
+				}
+				else if (response_rc == MEMCACHED_END)
+				{
+					// All items have been returned
+				}
+				else if (response_rc == MEMCACHED_SERVER_ERROR or response_rc == MEMCACHED_CLIENT_ERROR or response_rc == MEMCACHED_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.
+				 */
+					assert(response_rc == MEMCACHED_SUCCESS); // Just fail
+					return response_rc;
+				}
+				else
+				{
+					// IO error of some sort must have occurred
+					return response_rc;
+				}
       }
     }
   }
@@ -146,7 +163,7 @@ memcached_return_t memcached_dump(memcached_st *shell, memcached_dump_fn *callba
     return rc;
   }
 
-  /* 
+  /*
     No support for Binary protocol yet
     @todo Fix this so that we just flush, switch to ascii, and then go back to binary.
   */
diff --git a/tests/libmemcached-1.0/dump.cc b/tests/libmemcached-1.0/dump.cc
index 03704cf..a5429f3 100644
--- a/tests/libmemcached-1.0/dump.cc
+++ b/tests/libmemcached-1.0/dump.cc
@@ -1,5 +1,5 @@
 /*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
+ *
  *  Libmemcached library
  *
  *  Copyright (C) 2012 Data Differential, http://datadifferential.com/
@@ -49,8 +49,8 @@ using namespace libtest;
 #include "tests/libmemcached-1.0/dump.h"
 
 static memcached_return_t callback_dump_counter(const memcached_st *,
-                                                const char*, // key,
-                                                size_t, // length,
+                                                const char* key,
+                                                size_t length,
                                                 void *context)
 {
   size_t *counter= (size_t *)context;
@@ -122,7 +122,7 @@ test_return_t memcached_dump_TEST2(memcached_st *memc)
     test_compare(MEMCACHED_SUCCESS,
                  memcached_set(memc, key, length,
                                NULL, 0, // Zero length values
-                               time_t(0), uint32_t(0)));
+                               time_t(0) + 120, uint32_t(0)));
   }
   memcached_quit(memc);
 <commit_msg>Added small delay to the dump callback.<commit_after>diff --git a/libmemcached/dump.cc b/libmemcached/dump.cc
index 8ddb2ee..cc53ec6 100644
--- a/libmemcached/dump.cc
+++ b/libmemcached/dump.cc
@@ -1,5 +1,5 @@
 /*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
+ *
  *  Libmemcached library
  *
  *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
@@ -46,14 +46,16 @@
 
 static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callback, void *context, uint32_t number_of_callbacks)
 {
-  /* MAX_NUMBER_OF_SLAB_CLASSES is defined to 200 in Memcached 1.4.10 */
+
+//`	if memc->server_info.version
+  /* MAX_NUMBER_OF_SLAB_CLASSES is defined as 200 for memcached versions up to 1.4.22 and redefined to 64 above that.*/
   for (uint32_t x= 0; x < 200; x++)
   {
     char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
     int buffer_length= snprintf(buffer, sizeof(buffer), "%u", x);
     if (size_t(buffer_length) >= sizeof(buffer) or buffer_length < 0)
     {
-      return memcached_set_error(*memc, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, 
+      return memcached_set_error(*memc, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
                                  memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)"));
     }
 
@@ -70,15 +72,23 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac
     {
       memcached_instance_st* instance= memcached_instance_fetch(memc, server_key);
 
-      memcached_return_t vdo_rc;
-      if (memcached_success((vdo_rc= memcached_vdo(instance, vector, 3, true))))
-      {
-        // We have sent the message to the server successfully
-      }
-      else
-      {
-        return vdo_rc;
-      }
+      // Starting with version 1.4.23 the slab size went from 200 to 63.
+
+      // Starting with version 1.4.23 the slab size went from 200 to 63.
+      if (x <= 63 ||
+       (instance->major_version == 1 && instance->minor_version == 4 && instance->micro_version < 23) ||
+       (instance->major_version == 1 && instance->minor_version < 4))
+			{
+				memcached_return_t vdo_rc;
+				if (memcached_success((vdo_rc= memcached_vdo(instance, vector, 3, true))))
+				{
+					// We have sent the message to the server successfully
+				}
+				else
+				{
+					return vdo_rc;
+				}
+			}
     }
 
     // Collect the returned items
@@ -86,50 +96,57 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac
     memcached_return_t read_ret= MEMCACHED_SUCCESS;
     while ((instance= memcached_io_get_readable_server(memc, read_ret)))
     {
-      memcached_return_t response_rc= memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
-      if (response_rc == MEMCACHED_ITEM)
-      {
-        char *string_ptr, *end_ptr;
-
-        string_ptr= buffer;
-        string_ptr+= 5; /* Move past ITEM */
-
-        for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++) {} ;
-
-        char *key= string_ptr;
-        key[(size_t)(end_ptr-string_ptr)]= 0;
-
-        for (uint32_t callback_counter= 0; callback_counter < number_of_callbacks; callback_counter++)
-        {
-          memcached_return_t callback_rc= (*callback[callback_counter])(memc, key, (size_t)(end_ptr-string_ptr), context);
-          if (callback_rc != MEMCACHED_SUCCESS)
-          {
-            // @todo build up a message for the error from the value
-            memcached_set_error(*instance, callback_rc, MEMCACHED_AT);
-            break;
-          }
-        }
-      }
-      else if (response_rc == MEMCACHED_END)
-      { 
-        // All items have been returned
-      }
-      else if (response_rc == MEMCACHED_SERVER_ERROR or response_rc == MEMCACHED_CLIENT_ERROR or response_rc == MEMCACHED_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.
-       */
-        assert(response_rc == MEMCACHED_SUCCESS); // Just fail
-        return response_rc;
-      }
-      else
+
+      // Starting with version 1.4.23 the slab size went from 200 to 63.
+      if (x <= 63 ||
+       (instance->major_version == 1 && instance->minor_version == 4 && instance->micro_version < 23) ||
+       (instance->major_version == 1 && instance->minor_version < 4))
       {
-        // IO error of some sort must have occurred
-        return response_rc;
+				memcached_return_t response_rc= memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
+				if (response_rc == MEMCACHED_ITEM)
+				{
+					char *string_ptr, *end_ptr;
+
+					string_ptr= buffer;
+					string_ptr+= 5; /* Move past ITEM */
+
+					for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++) {} ;
+
+					char *key= string_ptr;
+					key[(size_t)(end_ptr-string_ptr)]= 0;
+
+					for (uint32_t callback_counter= 0; callback_counter < number_of_callbacks; callback_counter++)
+					{
+						memcached_return_t callback_rc= (*callback[callback_counter])(memc, key, (size_t)(end_ptr-string_ptr), context);
+						if (callback_rc != MEMCACHED_SUCCESS)
+						{
+							// @todo build up a message for the error from the value
+							memcached_set_error(*instance, callback_rc, MEMCACHED_AT);
+							break;
+						}
+					}
+				}
+				else if (response_rc == MEMCACHED_END)
+				{
+					// All items have been returned
+				}
+				else if (response_rc == MEMCACHED_SERVER_ERROR or response_rc == MEMCACHED_CLIENT_ERROR or response_rc == MEMCACHED_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.
+				 */
+					assert(response_rc == MEMCACHED_SUCCESS); // Just fail
+					return response_rc;
+				}
+				else
+				{
+					// IO error of some sort must have occurred
+					return response_rc;
+				}
       }
     }
   }
@@ -146,7 +163,7 @@ memcached_return_t memcached_dump(memcached_st *shell, memcached_dump_fn *callba
     return rc;
   }
 
-  /* 
+  /*
     No support for Binary protocol yet
     @todo Fix this so that we just flush, switch to ascii, and then go back to binary.
   */
diff --git a/tests/libmemcached-1.0/dump.cc b/tests/libmemcached-1.0/dump.cc
index 03704cf..2bb2db8 100644
--- a/tests/libmemcached-1.0/dump.cc
+++ b/tests/libmemcached-1.0/dump.cc
@@ -1,5 +1,5 @@
 /*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
+ *
  *  Libmemcached library
  *
  *  Copyright (C) 2012 Data Differential, http://datadifferential.com/
@@ -49,8 +49,8 @@ using namespace libtest;
 #include "tests/libmemcached-1.0/dump.h"
 
 static memcached_return_t callback_dump_counter(const memcached_st *,
-                                                const char*, // key,
-                                                size_t, // length,
+                                                const char* key,
+                                                size_t length,
                                                 void *context)
 {
   size_t *counter= (size_t *)context;
@@ -59,7 +59,7 @@ static memcached_return_t callback_dump_counter(const memcached_st *,
   std::cerr.write(key, length);
   std::cerr << std::endl;
 #endif
-
+  usleep(100);
   *counter= *counter +1;
 
   return MEMCACHED_SUCCESS;
@@ -122,7 +122,7 @@ test_return_t memcached_dump_TEST2(memcached_st *memc)
     test_compare(MEMCACHED_SUCCESS,
                  memcached_set(memc, key, length,
                                NULL, 0, // Zero length values
-                               time_t(0), uint32_t(0)));
+                               time_t(0) + 120, uint32_t(0)));
   }
   memcached_quit(memc);
 
{'fraction_non_alphanumeric': 0.11579664375503126, 'fraction_numerical': 0.024769335562573533, 'mean_word_length': 2.4791038345540715, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3015392', 'n_tokens_mistral': 6032, 'n_tokens_neox': 5393, 'n_words': 1301}