projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
0226480
)
Patches from Piotr Sikora < piotr.sikora@frickle.com > for OpenBSD.
author
Brian Aker
<brian@gaz>
Tue, 9 Feb 2010 18:30:12 +0000
(10:30 -0800)
committer
Brian Aker
<brian@gaz>
Tue, 9 Feb 2010 18:30:12 +0000
(10:30 -0800)
clients/memcapable.c
patch
|
blob
|
history
clients/memslap.c
patch
|
blob
|
history
clients/ms_conn.c
patch
|
blob
|
history
libmemcached/byteorder.c
patch
|
blob
|
history
libmemcached/byteorder.h
patch
|
blob
|
history
diff --git
a/clients/memcapable.c
b/clients/memcapable.c
index 5318ff014ac71a34910ffbecb775e4ec2e5c09c5..67146658821506d49307045cd00118b671febb36 100644
(file)
--- a/
clients/memcapable.c
+++ b/
clients/memcapable.c
@@
-342,7
+342,7
@@
static enum test_return recv_packet(response *rsp)
* @param dta the data to store with the key
* @param dtalen the length of the data to store with the key
* @param flags the flags to store along with the key
* @param dta the data to store with the key
* @param dtalen the length of the data to store with the key
* @param flags the flags to store along with the key
- * @param exp the expiry time for the key
+ * @param exp
time
the expiry time for the key
*/
static void storage_command(command *cmd,
uint8_t cc,
*/
static void storage_command(command *cmd,
uint8_t cc,
@@
-351,7
+351,7
@@
static void storage_command(command *cmd,
const void* dta,
size_t dtalen,
uint32_t flags,
const void* dta,
size_t dtalen,
uint32_t flags,
- uint32_t exp)
+ uint32_t exp
time
)
{
/* all of the storage commands use the same command layout */
protocol_binary_request_set *request= &cmd->set;
{
/* all of the storage commands use the same command layout */
protocol_binary_request_set *request= &cmd->set;
@@
-364,7
+364,7
@@
static void storage_command(command *cmd,
request->message.header.request.bodylen= (uint32_t)(keylen + 8 + dtalen);
request->message.header.request.opaque= 0xdeadbeef;
request->message.body.flags= flags;
request->message.header.request.bodylen= (uint32_t)(keylen + 8 + dtalen);
request->message.header.request.opaque= 0xdeadbeef;
request->message.body.flags= flags;
- request->message.body.expiration= exp;
+ request->message.body.expiration= exp
time
;
off_t key_offset= sizeof (protocol_binary_request_no_extras) + 8;
memcpy(cmd->bytes + key_offset, key, keylen);
off_t key_offset= sizeof (protocol_binary_request_no_extras) + 8;
memcpy(cmd->bytes + key_offset, key, keylen);
@@
-435,7
+435,7
@@
static void flush_command(command *cmd,
* @param keylen the number of bytes in the key
* @param delta the number to add/subtract
* @param initial the initial value if the key doesn't exist
* @param keylen the number of bytes in the key
* @param delta the number to add/subtract
* @param initial the initial value if the key doesn't exist
- * @param exp when the key should expire if it isn't set
+ * @param exp
time
when the key should expire if it isn't set
*/
static void arithmetic_command(command *cmd,
uint8_t cc,
*/
static void arithmetic_command(command *cmd,
uint8_t cc,
@@
-443,7
+443,7
@@
static void arithmetic_command(command *cmd,
size_t keylen,
uint64_t delta,
uint64_t initial,
size_t keylen,
uint64_t delta,
uint64_t initial,
- uint32_t exp)
+ uint32_t exp
time
)
{
memset(cmd, 0, sizeof (cmd->incr));
cmd->incr.message.header.request.magic= PROTOCOL_BINARY_REQ;
{
memset(cmd, 0, sizeof (cmd->incr));
cmd->incr.message.header.request.magic= PROTOCOL_BINARY_REQ;
@@
-454,7
+454,7
@@
static void arithmetic_command(command *cmd,
cmd->incr.message.header.request.opaque= 0xdeadbeef;
cmd->incr.message.body.delta= htonll(delta);
cmd->incr.message.body.initial= htonll(initial);
cmd->incr.message.header.request.opaque= 0xdeadbeef;
cmd->incr.message.body.delta= htonll(delta);
cmd->incr.message.body.initial= htonll(initial);
- cmd->incr.message.body.expiration= htonl(exp);
+ cmd->incr.message.body.expiration= htonl(exp
time
);
off_t key_offset= sizeof (protocol_binary_request_no_extras) + 20;
memcpy(cmd->bytes + key_offset, key, keylen);
off_t key_offset= sizeof (protocol_binary_request_no_extras) + 20;
memcpy(cmd->bytes + key_offset, key, keylen);
diff --git
a/clients/memslap.c
b/clients/memslap.c
index 18ac2dd1f2e187074d615bed58b02ea14da4fa17..38343b86de40f60f732a93cebcba0838e2a0ae90 100644
(file)
--- a/
clients/memslap.c
+++ b/
clients/memslap.c
@@
-112,7
+112,7
@@
static void ms_options_parse(int argc, char *argv[]);
static int ms_check_para(void);
static void ms_statistic_init(void);
static void ms_stats_init(void);
static int ms_check_para(void);
static void ms_statistic_init(void);
static void ms_stats_init(void);
-static void ms_print_statistics(int time);
+static void ms_print_statistics(int
in_
time);
static void ms_print_memslap_stats(struct timeval *start_time,
struct timeval *end_time);
static void ms_monitor_slap_mode(void);
static void ms_print_memslap_stats(struct timeval *start_time,
struct timeval *end_time);
static void ms_monitor_slap_mode(void);
diff --git
a/clients/ms_conn.c
b/clients/ms_conn.c
index 86e98fe1c74cfe2a0dc9a981ef31c7103c2f1ac5..005879bdaaed7a994df109a7493fe82565a3fe0c 100644
(file)
--- a/
clients/ms_conn.c
+++ b/
clients/ms_conn.c
@@
-797,7
+797,11
@@
static int ms_network_connect(ms_conn_t *c,
* that otherwise mess things up.
*/
memset(&hints, 0, sizeof(hints));
* that otherwise mess things up.
*/
memset(&hints, 0, sizeof(hints));
+#ifdef AI_ADDRCONFIG
hints.ai_flags= AI_PASSIVE | AI_ADDRCONFIG;
hints.ai_flags= AI_PASSIVE | AI_ADDRCONFIG;
+#else
++ hints.ai_flags= AI_PASSIVE;
+#endif /* AI_ADDRCONFIG */
if (is_udp)
{
hints.ai_protocol= IPPROTO_UDP;
if (is_udp)
{
hints.ai_protocol= IPPROTO_UDP;
diff --git
a/libmemcached/byteorder.c
b/libmemcached/byteorder.c
index 4b6eeb07acbeafaf2ea54107f15e824dcf47ed73..96a39bf88ff7d8fc166182b56c197ede274b24af 100644
(file)
--- a/
libmemcached/byteorder.c
+++ b/
libmemcached/byteorder.c
@@
-12,14
+12,14
@@
#include "byteorder.h"
/* Byte swap a 64-bit number. */
#include "byteorder.h"
/* Byte swap a 64-bit number. */
+#ifndef swap64
static inline uint64_t swap64(uint64_t in)
{
#ifndef WORDS_BIGENDIAN
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
static inline uint64_t swap64(uint64_t in)
{
#ifndef WORDS_BIGENDIAN
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
- uint8_t x= 0;
- for(x= 0; x < 8; x++)
+ for (uint8_t x= 0; x < 8; x++)
{
rv= (rv << 8) | (in & 0xff);
in >>= 8;
{
rv= (rv << 8) | (in & 0xff);
in >>= 8;
@@
-28,8
+28,9
@@
static inline uint64_t swap64(uint64_t in)
#else
/* big-endian machines don't need byte swapping */
return in;
#else
/* big-endian machines don't need byte swapping */
return in;
-#endif
+#endif
// WORDS_BIGENDIAN
}
}
+#endif
uint64_t ntohll(uint64_t value)
{
uint64_t ntohll(uint64_t value)
{
diff --git
a/libmemcached/byteorder.h
b/libmemcached/byteorder.h
index df47cc691e86fbdfc1a056a22242d630d2bd1d0a..f43dbc435f8dc30eb29936b6d4b2f018bb8670e3 100644
(file)
--- a/
libmemcached/byteorder.h
+++ b/
libmemcached/byteorder.h
@@
-14,6
+14,11
@@
#include "config.h"
#include "config.h"
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+
/* Define this here, which will turn on the visibilty controls while we're
* building libmemcached.
*/
/* Define this here, which will turn on the visibilty controls while we're
* building libmemcached.
*/