projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fixed return length issues.
[m6w6/libmemcached]
/
src
/
memslap.c
diff --git
a/src/memslap.c
b/src/memslap.c
index ff01ddc180d5bf7a6ba8e9e6e9e1871bc40d86fc..5815015905d90fa7547f21a2735ee3f12ddfefe7 100644
(file)
--- a/
src/memslap.c
+++ b/
src/memslap.c
@@
-1,5
+1,6
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
@@
-88,9
+89,16
@@
int main(int argc, char *argv[])
options_parse(argc, argv);
if (!opt_servers)
options_parse(argc, argv);
if (!opt_servers)
- exit(0);
+ {
+ char *temp;
+
+ if ((temp= getenv("MEMCACHED_SERVERS")))
+ opt_servers= strdup(temp);
+ else
+ exit(1);
+ }
- servers=
parse_opt_servers
(opt_servers);
+ servers=
memcached_servers_parse
(opt_servers);
pthread_mutex_init(&counter_mutex, NULL);
pthread_cond_init(&count_threshhold, NULL);
pthread_mutex_init(&counter_mutex, NULL);
pthread_cond_init(&count_threshhold, NULL);
@@
-302,12
+310,13
@@
void *run_task(void *p)
{
thread_context_st *context= (thread_context_st *)p;
memcached_st *memc;
{
thread_context_st *context= (thread_context_st *)p;
memcached_st *memc;
+ unsigned int value= 1;
memc= memcached_create(NULL);
if (opt_non_blocking_io)
memc= memcached_create(NULL);
if (opt_non_blocking_io)
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK,
NULL
);
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK,
&value
);
if (opt_tcp_nodelay)
if (opt_tcp_nodelay)
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY,
NULL
);
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY,
&value
);
memcached_server_push(memc, context->servers);
memcached_server_push(memc, context->servers);