tests: honor EPIPE in kill(HUP) test
[awesomized/libmemcached] / clients / ms_conn.c
index 2cbc7e0b384acbae901aae90c42656d969eb5981..85e84739835b0c3af8b8709a189f5eefa438c79d 100644 (file)
@@ -1160,7 +1160,12 @@ static int ms_ascii_process_line(ms_conn_t *c, char *command)
     {
       token_t tokens[MAX_TOKENS];
       ms_tokenize_command(command, tokens, MAX_TOKENS);
+      errno= 0;
       value_len= strtol(tokens[VALUELEN_TOKEN].value, NULL, 10);
+      if (errno != 0)
+      {
+        printf("<%d ERROR %s\n", c->sfd, strerror(errno));
+      }
       c->currcmd.key_prefix= *(uint64_t *)tokens[KEY_TOKEN].value;
 
       /*
@@ -1179,6 +1184,7 @@ static int ms_ascii_process_line(ms_conn_t *c, char *command)
 
   case 'O':   /* OK */
     c->currcmd.retstat= MCD_SUCCESS;
+    break;
 
   case 'S':                    /* STORED STATS SERVER_ERROR */
     if (buffer[2] == 'A')      /* STORED STATS */
@@ -2339,7 +2345,7 @@ static void ms_conn_shrink(ms_conn_t *c)
       && (c->rudpbytes + UDP_MAX_PAYLOAD_SIZE < UDP_DATA_BUFFER_SIZE))
   {
     char *new_rbuf= (char *)realloc(c->rudpbuf, (size_t)c->rudpsize * 2);
-    if (new_rbuf)
+    if (new_rbuf)
     {
       c->rudpbuf= new_rbuf;
       c->rudpsize= UDP_DATA_BUFFER_SIZE;