projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
tests: honor EPIPE in kill(HUP) test
[awesomized/libmemcached]
/
clients
/
ms_conn.c
diff --git
a/clients/ms_conn.c
b/clients/ms_conn.c
index 3a6fd8e7da3b4ce269cac9c8e9d4fde4e4d80310..85e84739835b0c3af8b8709a189f5eefa438c79d 100644
(file)
--- a/
clients/ms_conn.c
+++ b/
clients/ms_conn.c
@@
-9,7
+9,7
@@
*
*/
*
*/
-#include "config.h"
+#include "
mem_
config.h"
#include <stdio.h>
#include <inttypes.h>
#include <stdio.h>
#include <inttypes.h>
@@
-20,16
+20,15
@@
#include <netinet/tcp.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#if TIME_WITH_SYS_TIME
+
+#if defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
# include <sys/time.h>
+#endif
+
+#if defined(HAVE_TIME_H)
# include <time.h>
# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
#endif
#endif
+
#include "ms_setting.h"
#include "ms_thread.h"
#include "ms_atomic.h"
#include "ms_setting.h"
#include "ms_thread.h"
#include "ms_atomic.h"
@@
-358,7
+357,7
@@
static int ms_conn_init(ms_conn_t *c,
c->mlget_task.mlget_num= 0;
c->mlget_task.value_index= -1; /* default invalid value */
c->mlget_task.mlget_num= 0;
c->mlget_task.value_index= -1; /* default invalid value */
- if (ms_setting.binary_prot)
+ if (ms_setting.binary_prot
_
)
{
c->protocol= binary_prot;
}
{
c->protocol= binary_prot;
}
@@
-759,6
+758,7
@@
static void ms_maximize_sndbuf(const int sfd)
max= avg - 1;
}
}
max= avg - 1;
}
}
+ (void)last_good;
} /* ms_maximize_sndbuf */
} /* ms_maximize_sndbuf */
@@
-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);
{
token_t tokens[MAX_TOKENS];
ms_tokenize_command(command, tokens, MAX_TOKENS);
+ errno= 0;
value_len= strtol(tokens[VALUELEN_TOKEN].value, NULL, 10);
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;
/*
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;
case 'O': /* OK */
c->currcmd.retstat= MCD_SUCCESS;
+ break;
case 'S': /* STORED STATS SERVER_ERROR */
if (buffer[2] == 'A') /* STORED STATS */
case 'S': /* STORED STATS SERVER_ERROR */
if (buffer[2] == 'A') /* STORED STATS */
@@
-1544,6
+1550,7
@@
static int ms_sort_udp_packet(ms_conn_t *c, char *buf, int rbytes)
break;
}
}
break;
}
}
+ (void)packets;
return wbytes == 0 ? -1 : wbytes;
} /* ms_sort_udp_packet */
return wbytes == 0 ? -1 : wbytes;
} /* ms_sort_udp_packet */
@@
-2338,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);
&& (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;
{
c->rudpbuf= new_rbuf;
c->rudpsize= UDP_DATA_BUFFER_SIZE;
@@
-3159,6
+3166,8
@@
int ms_mcd_mlget(ms_conn_t *c)
atomic_add_size(&ms_stats.cmd_get, 1);
}
atomic_add_size(&ms_stats.cmd_get, 1);
}
+ (void)item;
+
return EXIT_SUCCESS;
} /* ms_mcd_mlget */
return EXIT_SUCCESS;
} /* ms_mcd_mlget */