+ if ((ptr->flags & MEM_BUFFER_REQUESTS))
+ {
+ rc[replicas]= MEMCACHED_BUFFERED;
+ }
+ else
+ {
+ rc[replicas]= memcached_response(&ptr->hosts[server_key], buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
+ if (rc[replicas] == MEMCACHED_DELETED)
+ rc[replicas]= MEMCACHED_SUCCESS;
+ }
+
+ /* On error we just jump to the next potential server */
+error:
+ if (ptr->number_of_replicas > 1)
+ {
+ if (server_key == (ptr->number_of_hosts - 1))
+ server_key= 0;
+ else
+ server_key++;
+ }
+ } while ((++replicas) < ptr->number_of_replicas);
+
+ /* As long as one object gets stored, we count this as a success */
+ while (replicas--)
+ {
+ if (rc[replicas] == MEMCACHED_DELETED)
+ return MEMCACHED_SUCCESS;
+ else if (rc[replicas] == MEMCACHED_DELETED)
+ rc[replicas]= MEMCACHED_BUFFERED;