Fix from Charles Aylward for reuse of buffer.
author <brian@gir-2.local> <>
Fri, 29 Feb 2008 07:30:56 +0000 (23:30 -0800)
committer <brian@gir-2.local> <>
Fri, 29 Feb 2008 07:30:56 +0000 (23:30 -0800)
lib/memcached_storage.c

index 2a0f88d493f355df2e862af79dfd1c8d8b2b22af..aac9b9227cae8d1c77f62ee0a912a86f53e39fb3 100644 (file)
@@ -91,6 +91,8 @@ static inline memcached_return memcached_send(memcached_st *ptr,
 
   do
   {
+    char response_buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
+
     rc[replicas]=  memcached_do(&ptr->hosts[server_key], buffer, write_length, 0);
 
     if (rc[replicas] != MEMCACHED_SUCCESS)
@@ -111,7 +113,8 @@ static inline memcached_return memcached_send(memcached_st *ptr,
     if (to_write == 0)
       return MEMCACHED_BUFFERED;
     else
-      rc[replicas]= memcached_response(&ptr->hosts[server_key], buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
+      rc[replicas]= memcached_response(&ptr->hosts[server_key],
+                                       response_buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
 
     /* On error we just jump to the next potential server */
 error: