the server had not caught up with the client.
#define WATCHPOINT_STRING(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout);
#define WATCHPOINT_STRING_LENGTH(A,B) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout);
#define WATCHPOINT_NUMBER(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout);
-#define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));A= 0;fflush(stdout);
+#define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout);
#define WATCHPOINT_ASSERT(A) assert((A));
#else
#define WATCHPOINT
uint8_t found_eof= 0;
if (!ptr->read_buffer_length)
{
- size_t data_read;
+ ssize_t data_read;
while (1)
{
data_read= read(ptr->fd,
ptr->read_buffer,
MEMCACHED_MAX_BUFFER);
- if (data_read)
+ if (data_read > 0)
break;
else if (data_read == -1)
{
while (1)
{
- unsigned int read_length;
+ ssize_t read_length;
read_length= memcached_io_read(ptr, buffer_ptr, 1);
+ WATCHPOINT_ASSERT(isgraph(*buffer_ptr) || isspace(*buffer_ptr));
if (read_length != 1)
return MEMCACHED_UNKNOWN_READ_FAILURE;
memcached_return rc;
char *key= "foo";
char *value= "when we sanitize";
+ char *original= "first we insert some data";
+
+ rc= memcached_set(memc, key, strlen(key),
+ original, strlen(original),
+ (time_t)0, (uint32_t)0);
+ assert(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED);
rc= memcached_replace(memc, key, strlen(key),
value, strlen(value),
{"set2", 0, set_test2 },
{"set3", 0, set_test3 },
{"add", 1, add_test },
- {"replace", 0, replace_test },
+ {"replace", 1, replace_test },
{"delete", 1, delete_test },
{"get", 1, get_test },
{"get2", 0, get_test2 },