projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
cmake: 3.12 compatibility
[m6w6/libmemcached]
/
clients
/
ms_conn.c
diff --git
a/clients/ms_conn.c
b/clients/ms_conn.c
index c4f1b87b965302b75ec392e434660b6531938344..71353d5b4806defd0b7f93bc6f611fbd775f130a 100644
(file)
--- a/
clients/ms_conn.c
+++ b/
clients/ms_conn.c
@@
-19,7
+19,10
@@
#include <fcntl.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
+
+#if defined(HAVE_ARPA_INET_H)
+# include <arpa/inet.h>
+#endif
#if defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
#if defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
@@
-63,7
+66,7
@@
static uint64_t key_prefix_seq= KEY_PREFIX_BASE;
/* global increasing counter, generating request id for UDP */
static uint64_t key_prefix_seq= KEY_PREFIX_BASE;
/* global increasing counter, generating request id for UDP */
-static
volatile
uint32_t udp_request_id= 0;
+static
ATOMIC
uint32_t udp_request_id= 0;
extern pthread_key_t ms_thread_key;
extern pthread_key_t ms_thread_key;
@@
-758,6
+761,7
@@
static void ms_maximize_sndbuf(const int sfd)
max= avg - 1;
}
}
max= avg - 1;
}
}
+ (void)last_good;
} /* ms_maximize_sndbuf */
} /* ms_maximize_sndbuf */
@@
-1159,7
+1163,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;
/*
@@
-1178,6
+1187,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 */
@@
-1543,6
+1553,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 */
@@
-2337,7
+2348,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;
@@
-3158,6
+3169,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 */