From 5ab3cfccd05bf4375edf1a5f3cab85be97220b60 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 2 Aug 2010 20:54:30 -0700 Subject: [PATCH 01/16] if/def a WATCHPOINT --- clients/ms_setting.c | 1 - libmemcached/io.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/ms_setting.c b/clients/ms_setting.c index ac76853f..d7099709 100644 --- a/clients/ms_setting.c +++ b/clients/ms_setting.c @@ -19,7 +19,6 @@ #include #include #include -#include #include diff --git a/libmemcached/io.c b/libmemcached/io.c index 9a20609b..299242f6 100644 --- a/libmemcached/io.c +++ b/libmemcached/io.c @@ -613,8 +613,10 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, if (sent_length == SOCKET_ERROR) { ptr->cached_errno= get_socket_errno(); +#if 0 // @todo I should look at why we hit this bit of code hard frequently WATCHPOINT_ERRNO(get_socket_errno()); WATCHPOINT_NUMBER(get_socket_errno()); +#endif switch (get_socket_errno()) { case ENOBUFS: -- 2.30.2 From 6b46b12051fa265bbd9c2a17899a280c8bd82769 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 2 Aug 2010 21:30:04 -0700 Subject: [PATCH 02/16] Remove use of system(). Not very portable --- tests/server.c | 99 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 35 deletions(-) diff --git a/tests/server.c b/tests/server.c index 70c0ae3b..e2781b26 100644 --- a/tests/server.c +++ b/tests/server.c @@ -17,19 +17,45 @@ #include "config.h" +#include +#include +#include #include #include #include +#include #include -#include -#include +#include + #include #include -#include -#include #include "server.h" +static void kill_file(const char *file_buffer) +{ + FILE *fp= fopen(file_buffer, "r"); + + if (fp != NULL) + { + char pid_buffer[1024]; + + if (fgets(pid_buffer, sizeof(pid_buffer), fp) != NULL) + { + pid_t pid= (pid_t)atoi(pid_buffer); + if (pid != 0) + { + if (kill(pid, SIGTERM) == -1) + { + perror(file_buffer); + } + } + } + + fclose(fp); + } +} + void server_startup(server_startup_st *construct) { if ((construct->server_list= getenv("MEMCACHED_SERVERS"))) @@ -48,7 +74,6 @@ void server_startup(server_startup_st *construct) for (uint32_t x= 0; x < construct->count; x++) { - char buffer[1024]; /* Nothing special for number */ int count; int status; in_port_t port; @@ -69,34 +94,36 @@ void server_startup(server_startup_st *construct) } } - sprintf(buffer, "/tmp/%umemc.pid", x); - if (access(buffer, F_OK) == 0) - { - FILE *fp= fopen(buffer, "r"); - remove(buffer); + char buffer[PATH_MAX]; - if (fp != NULL) + snprintf(buffer, sizeof(buffer), "/tmp/%umemc.pid", x); + + uint32_t counter= 3; + while (--counter) + { + if (access(buffer, F_OK) == 0) { - if (fgets(buffer, sizeof(buffer), fp) != NULL) - { - pid_t pid= (pid_t)atoi(buffer); - if (pid != 0) - kill(pid, SIGTERM); - } - - fclose(fp); + kill_file(buffer); +#ifndef WIN32 + struct timespec req= { .tv_sec= 0, .tv_nsec= 5000 }; + nanosleep(&req, NULL); +#endif + } + else + { + break; } } if (x == 0) { - sprintf(buffer, "%s -d -u root -P /tmp/%umemc.pid -t 1 -p %u -U %u -m 128", - MEMCACHED_BINARY, x, port, port); + snprintf(buffer, sizeof(buffer), "%s -d -u root -P /tmp/%umemc.pid -t 1 -p %u -U %u -m 128", + MEMCACHED_BINARY, x, port, port); } else { - sprintf(buffer, "%s -d -u root -P /tmp/%umemc.pid -t 1 -p %u -U %u", - MEMCACHED_BINARY, x, port, port); + snprintf(buffer, sizeof(buffer), "%s -d -u root -P /tmp/%umemc.pid -t 1 -p %u -U %u", + MEMCACHED_BINARY, x, port, port); } if (libmemcached_util_ping("localhost", port, NULL)) { @@ -115,10 +142,11 @@ void server_startup(server_startup_st *construct) for (uint32_t x= 0; x < construct->count; x++) { uint32_t counter= 3; - char buffer[1024]; /* Nothing special for number */ + char buffer[PATH_MAX]; /* Nothing special for number */ snprintf(buffer, sizeof(buffer), "/tmp/%umemc.pid", x); + bool was_started= false; while (--counter) { int memcached_pid; @@ -135,15 +163,20 @@ void server_startup(server_startup_st *construct) } char *found= fgets(buffer, sizeof(buffer), file); if (!found) - { - abort(); - } + continue; + // Yes, we currently pitch this and don't make use of it. memcached_pid= atoi(buffer); fclose(file); + was_started= true; + break; } - + if (was_started == false) + { + fprintf(stderr, "Failed to open buffer %s\n", buffer); + abort(); + } } construct->server_list= strdup(server_string_buffer); @@ -172,13 +205,9 @@ void server_shutdown(server_startup_st *construct) { for (uint32_t x= 0; x < construct->count; x++) { - char buffer[1024]; /* Nothing special for number */ - sprintf(buffer, "cat /tmp/%umemc.pid | xargs kill", x); - /* We have to check the return value of this or the compiler will yell */ - int sys_ret= system(buffer); - assert(sys_ret != -1); - sprintf(buffer, "/tmp/%umemc.pid", x); - unlink(buffer); + char file_buffer[PATH_MAX]; /* Nothing special for number */ + snprintf(file_buffer, sizeof(file_buffer), "/tmp/%umemc.pid", x); + kill_file(file_buffer); } free(construct->server_list); -- 2.30.2 From 668f7f1e1eec0a2290d2c05376e45b0d3169d02c Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 2 Aug 2010 23:31:32 -0700 Subject: [PATCH 03/16] Looking at additional race conditions in test harness. --- tests/server.c | 118 +++++++++++++++++++++++++++++-------------------- 1 file changed, 71 insertions(+), 47 deletions(-) diff --git a/tests/server.c b/tests/server.c index e2781b26..4db656f1 100644 --- a/tests/server.c +++ b/tests/server.c @@ -15,6 +15,8 @@ #define TEST_PORT_BASE MEMCACHED_DEFAULT_PORT+10 +#define PID_FILE_BASE "/tmp/%ulibmemcached_memc.pid" + #include "config.h" #include @@ -32,11 +34,22 @@ #include "server.h" +static struct timespec global_sleep_value= { .tv_sec= 0, .tv_nsec= 50000 }; + +static void global_sleep(void) +{ +#ifdef WIN32 + sleep(1); +#else + nanosleep(&global_sleep_value, NULL); +#endif +} + static void kill_file(const char *file_buffer) { FILE *fp= fopen(file_buffer, "r"); - if (fp != NULL) + while ((fp= fopen(file_buffer, "r"))) { char pid_buffer[1024]; @@ -47,11 +60,21 @@ static void kill_file(const char *file_buffer) { if (kill(pid, SIGTERM) == -1) { - perror(file_buffer); + remove(file_buffer); // If this happens we may be dealing with a dead server that left its pid file. + } + else + { + uint32_t counter= 3; + while ((kill(pid, 0) == 0) && --counter) + { + global_sleep(); + } } } } + global_sleep(); + fclose(fp); } } @@ -95,34 +118,17 @@ void server_startup(server_startup_st *construct) } char buffer[PATH_MAX]; - - snprintf(buffer, sizeof(buffer), "/tmp/%umemc.pid", x); - - uint32_t counter= 3; - while (--counter) - { - if (access(buffer, F_OK) == 0) - { - kill_file(buffer); -#ifndef WIN32 - struct timespec req= { .tv_sec= 0, .tv_nsec= 5000 }; - nanosleep(&req, NULL); -#endif - } - else - { - break; - } - } + snprintf(buffer, sizeof(buffer), PID_FILE_BASE, x); + kill_file(buffer); if (x == 0) { - snprintf(buffer, sizeof(buffer), "%s -d -u root -P /tmp/%umemc.pid -t 1 -p %u -U %u -m 128", + snprintf(buffer, sizeof(buffer), "%s -d -u root -P "PID_FILE_BASE" -t 1 -p %u -U %u -m 128", MEMCACHED_BINARY, x, port, port); } else { - snprintf(buffer, sizeof(buffer), "%s -d -u root -P /tmp/%umemc.pid -t 1 -p %u -U %u", + snprintf(buffer, sizeof(buffer), "%s -d -u root -P "PID_FILE_BASE" -t 1 -p %u -U %u", MEMCACHED_BINARY, x, port, port); } if (libmemcached_util_ping("localhost", port, NULL)) @@ -139,45 +145,63 @@ void server_startup(server_startup_st *construct) } *end_ptr= 0; + + int *pids= calloc(construct->count, sizeof(int)); for (uint32_t x= 0; x < construct->count; x++) { - uint32_t counter= 3; char buffer[PATH_MAX]; /* Nothing special for number */ - snprintf(buffer, sizeof(buffer), "/tmp/%umemc.pid", x); + snprintf(buffer, sizeof(buffer), PID_FILE_BASE, x); - bool was_started= false; - while (--counter) + uint32_t counter= 3000; // Absurd, just to catch run away process + while (pids[x] <= 0 && --counter) { - int memcached_pid; + FILE *file= fopen(buffer, "r"); + if (file) + { + char pid_buffer[1024]; + char *found= fgets(pid_buffer, sizeof(pid_buffer), file); + + if (found) + { + pids[x]= atoi(pid_buffer); + fclose(file); + + if (pids[x] > 0) + break; + } + fclose(file); + } + global_sleep(); + } - FILE *file; - file= fopen(buffer, "r"); - if (file == NULL) + bool was_started= false; + if (pids[x] > 0) + { + counter= 30; + while (--counter) { -#ifndef WIN32 - struct timespec req= { .tv_sec= 0, .tv_nsec= 5000 }; - nanosleep(&req, NULL); -#endif - continue; + if (kill(pids[x], 0) == 0) + { + was_started= true; + break; + } + global_sleep(); } - char *found= fgets(buffer, sizeof(buffer), file); - if (!found) - continue; - - // Yes, we currently pitch this and don't make use of it. - memcached_pid= atoi(buffer); - fclose(file); - was_started= true; - break; } if (was_started == false) { - fprintf(stderr, "Failed to open buffer %s\n", buffer); + fprintf(stderr, "Failed to open buffer %s(%d)\n", buffer, pids[x]); + for (uint32_t y= 0; y < construct->count; y++) + { + if (pids[y] > 0) + kill(pids[y], SIGTERM); + } abort(); } } + free(pids); construct->server_list= strdup(server_string_buffer); } @@ -206,7 +230,7 @@ void server_shutdown(server_startup_st *construct) for (uint32_t x= 0; x < construct->count; x++) { char file_buffer[PATH_MAX]; /* Nothing special for number */ - snprintf(file_buffer, sizeof(file_buffer), "/tmp/%umemc.pid", x); + snprintf(file_buffer, sizeof(file_buffer), PID_FILE_BASE, x); kill_file(file_buffer); } -- 2.30.2 From c79b88bc75d37c933e9d05c83113ccb26ded3683 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Fri, 13 Aug 2010 14:58:56 +0200 Subject: [PATCH 04/16] Add option -P and -T to memcapable The two options come in handy if you're trying to debug a failing test case --- clients/memcapable.c | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/clients/memcapable.c b/clients/memcapable.c index 25278617..8fa783eb 100644 --- a/clients/memcapable.c +++ b/clients/memcapable.c @@ -1869,8 +1869,10 @@ int main(int argc, char **argv) const char *hostname= "localhost"; const char *port= "11211"; int cmd; + bool prompt= false; + const char *testname= NULL; - while ((cmd= getopt(argc, argv, "t:vch:p:?")) != EOF) + while ((cmd= getopt(argc, argv, "t:vch:p:PT:?")) != EOF) { switch (cmd) { case 't': @@ -1889,11 +1891,21 @@ int main(int argc, char **argv) break; case 'p': port= optarg; break; + case 'P': prompt= true; + break; + case 'T': testname= optarg; + break; default: - fprintf(stderr, "Usage: %s [-h hostname] [-p port] [-c] [-v] [-t n]\n" + fprintf(stderr, "Usage: %s [-h hostname] [-p port] [-c] [-v] [-t n]" + " [-P] [-T testname]'\n" "\t-c\tGenerate coredump if a test fails\n" "\t-v\tVerbose test output (print out the assertion)\n" - "\t-t n\tSet the timeout for io-operations to n seconds\n", + "\t-t n\tSet the timeout for io-operations to n seconds\n" + "\t-P\tPrompt the user before starting a test.\n" + "\t\t\t\"skip\" will skip the test\n" + "\t\t\t\"quit\" will terminate memcapable\n" + "\t\t\tEverything else will start the test\n" + "\t-T n\tJust run the test named n\n", argv[0]); return 1; } @@ -1910,10 +1922,32 @@ int main(int argc, char **argv) for (int ii= 0; testcases[ii].description != NULL; ++ii) { + if (testname != NULL && strcmp(testcases[ii].description, testname) != 0) + continue; + ++total; fprintf(stdout, "%-40s", testcases[ii].description); fflush(stdout); + if (prompt) + { + fprintf(stdout, "\nPress when you are ready? "); + char buffer[80] = {0}; + (void)fgets(buffer, sizeof(buffer), stdin); + if (strncmp(buffer, "skip", 4) == 0) + { + fprintf(stdout, "%-40s%s\n", testcases[ii].description, + status_msg[TEST_SKIP]); + fflush(stdout); + continue; + } + if (strncmp(buffer, "quit", 4) == 0) + exit(0); + + fprintf(stdout, "%-40s", testcases[ii].description); + fflush(stdout); + } + bool reconnect= false; enum test_return ret= testcases[ii].function(); if (ret == TEST_FAIL) -- 2.30.2 From 2e3605904e66587a2324011de900b57d6dbce89e Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Fri, 13 Aug 2010 15:01:34 +0200 Subject: [PATCH 05/16] Update memcapable quiet command test to work with servers that cork --- clients/memcapable.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/clients/memcapable.c b/clients/memcapable.c index 8fa783eb..e64655b9 100644 --- a/clients/memcapable.c +++ b/clients/memcapable.c @@ -303,6 +303,7 @@ static enum test_return retry_read(void *buf, size_t len) ssize_t nr= timeout_io_op(sock, POLLIN, ((char*) buf) + offset, len - offset); switch (nr) { case -1 : + fprintf(stderr, "Errno: %d %s\n", get_socket_errno(), strerror(errno)); verify(get_socket_errno() == EINTR || get_socket_errno() == EAGAIN); break; case 0: @@ -321,7 +322,7 @@ static enum test_return retry_read(void *buf, size_t len) */ static enum test_return recv_packet(response *rsp) { - execute(retry_read(rsp, sizeof (protocol_binary_response_no_extras))); + execute(retry_read(rsp, sizeof(protocol_binary_response_no_extras))); /* Fix the byte order in the packet header */ rsp->plain.message.header.response.keylen= @@ -693,10 +694,12 @@ static enum test_return test_binary_set_impl(const char* key, uint8_t cc) cmd.plain.message.header.request.cas= htonll(rsp.plain.message.header.response.cas - 1); execute(resend_packet(&cmd)); + execute(send_binary_noop()); execute(recv_packet(&rsp)); verify(validate_response_header(&rsp, cc, PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS)); + execute(receive_binary_noop()); - return test_binary_noop(); + return TEST_PASS; } static enum test_return test_binary_set(void) @@ -733,7 +736,9 @@ static enum test_return test_binary_add_impl(const char* key, uint8_t cc) else expected_result= PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS; + execute(send_binary_noop()); execute(recv_packet(&rsp)); + execute(receive_binary_noop()); verify(validate_response_header(&rsp, cc, expected_result)); } else @@ -790,7 +795,9 @@ static enum test_return test_binary_replace_impl(const char* key, uint8_t cc) else expected_result=PROTOCOL_BINARY_RESPONSE_SUCCESS; + execute(send_binary_noop()); execute(recv_packet(&rsp)); + execute(receive_binary_noop()); verify(validate_response_header(&rsp, cc, expected_result)); if (ii == 0) @@ -817,7 +824,9 @@ static enum test_return test_binary_replace_impl(const char* key, uint8_t cc) cmd.plain.message.header.request.cas= htonll(rsp.plain.message.header.response.cas - 1); execute(resend_packet(&cmd)); + execute(send_binary_noop()); execute(recv_packet(&rsp)); + execute(receive_binary_noop()); verify(validate_response_header(&rsp, cc, PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS)); return TEST_PASS; @@ -841,8 +850,10 @@ static enum test_return test_binary_delete_impl(const char *key, uint8_t cc) /* The delete shouldn't work the first time, because the item isn't there */ execute(send_packet(&cmd)); + execute(send_binary_noop()); execute(recv_packet(&rsp)); verify(validate_response_header(&rsp, cc, PROTOCOL_BINARY_RESPONSE_KEY_ENOENT)); + execute(receive_binary_noop()); execute(binary_set_item(key, key)); /* The item should be present now, resend*/ -- 2.30.2 From 677431851174f20bdbb6566700e22a9914c3e6fb Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Tue, 24 Aug 2010 19:28:46 +0200 Subject: [PATCH 06/16] Check the return code from fgets in memcapable --- clients/memcapable.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/clients/memcapable.c b/clients/memcapable.c index e64655b9..6ef5bc69 100644 --- a/clients/memcapable.c +++ b/clients/memcapable.c @@ -1944,16 +1944,17 @@ int main(int argc, char **argv) { fprintf(stdout, "\nPress when you are ready? "); char buffer[80] = {0}; - (void)fgets(buffer, sizeof(buffer), stdin); - if (strncmp(buffer, "skip", 4) == 0) - { - fprintf(stdout, "%-40s%s\n", testcases[ii].description, - status_msg[TEST_SKIP]); - fflush(stdout); - continue; + if (fgets(buffer, sizeof(buffer), stdin) != NULL) { + if (strncmp(buffer, "skip", 4) == 0) + { + fprintf(stdout, "%-40s%s\n", testcases[ii].description, + status_msg[TEST_SKIP]); + fflush(stdout); + continue; + } + if (strncmp(buffer, "quit", 4) == 0) + exit(0); } - if (strncmp(buffer, "quit", 4) == 0) - exit(0); fprintf(stdout, "%-40s", testcases[ii].description); fflush(stdout); -- 2.30.2 From c69683a3ed52209fafa165c4e78cc49e4a60dd6b Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Thu, 2 Sep 2010 10:23:44 +0200 Subject: [PATCH 07/16] Bug 628650: prefix ntohll/htonll with memcached_ --- libmemcached/byteorder.c | 4 ++-- libmemcached/byteorder.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libmemcached/byteorder.c b/libmemcached/byteorder.c index 96a39bf8..97d14f2b 100644 --- a/libmemcached/byteorder.c +++ b/libmemcached/byteorder.c @@ -32,12 +32,12 @@ static inline uint64_t swap64(uint64_t in) } #endif -uint64_t ntohll(uint64_t value) +uint64_t memcached_ntohll(uint64_t value) { return swap64(value); } -uint64_t htonll(uint64_t value) +uint64_t memcached_htonll(uint64_t value) { return swap64(value); } diff --git a/libmemcached/byteorder.h b/libmemcached/byteorder.h index f43dbc43..90a71ee4 100644 --- a/libmemcached/byteorder.h +++ b/libmemcached/byteorder.h @@ -27,10 +27,13 @@ #include "libmemcached/memcached.h" #ifndef HAVE_HTONLL +#define ntohll(a) memcached_ntohll(a) +#define htonll(a) memcached_htonll(a) + LIBMEMCACHED_LOCAL -uint64_t ntohll(uint64_t); +uint64_t memcached_ntohll(uint64_t); LIBMEMCACHED_LOCAL -uint64_t htonll(uint64_t); +uint64_t memcached_htonll(uint64_t); #endif #ifdef linux -- 2.30.2 From 34e1545e2bdf048cb1634cdcbdbe3b4fb80c2416 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Sat, 11 Sep 2010 12:56:27 +0200 Subject: [PATCH 08/16] Fixed test in memcached_set_sasl_auth_data --- libmemcached/sasl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmemcached/sasl.c b/libmemcached/sasl.c index 85edeb3d..f2e346a6 100644 --- a/libmemcached/sasl.c +++ b/libmemcached/sasl.c @@ -221,7 +221,7 @@ memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, const char *password) { if (ptr == NULL || username == NULL || - password == NULL || ptr->sasl->callbacks != NULL) + password == NULL || ptr->sasl != NULL) { return MEMCACHED_FAILURE; } -- 2.30.2 From 229c01e4aa9162f2f4723214ee4aabc1025f0e6b Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Mon, 13 Sep 2010 08:05:34 +0200 Subject: [PATCH 09/16] Fixed SASL authentication bits --- libmemcached/connect.c | 2 +- libmemcached/memcached.c | 7 +-- libmemcached/memcached.h | 2 +- libmemcached/sasl.c | 95 +++++++++++++++++----------------------- 4 files changed, 47 insertions(+), 59 deletions(-) diff --git a/libmemcached/connect.c b/libmemcached/connect.c index 1f0175f2..c4b263e1 100644 --- a/libmemcached/connect.c +++ b/libmemcached/connect.c @@ -536,7 +536,7 @@ memcached_return_t memcached_connect(memcached_server_write_instance_st ptr) case MEMCACHED_CONNECTION_TCP: rc= network_connect(ptr); #ifdef LIBMEMCACHED_WITH_SASL_SUPPORT - if (ptr->fd != INVALID_SOCKET && ptr->root->sasl && ptr->root->sasl->callbacks) + if (ptr->fd != INVALID_SOCKET && ptr->root->sasl.callbacks) { rc= memcached_sasl_authenticate_connection(ptr); if (rc != MEMCACHED_SUCCESS) diff --git a/libmemcached/memcached.c b/libmemcached/memcached.c index d5411e86..81895afa 100644 --- a/libmemcached/memcached.c +++ b/libmemcached/memcached.c @@ -92,7 +92,8 @@ static inline bool _memcached_init(memcached_st *self) self->get_key_failure= NULL; self->delete_trigger= NULL; self->callbacks= NULL; - self->sasl= NULL; + self->sasl.callbacks= NULL; + self->sasl.is_allocated= false; return true; } @@ -176,7 +177,7 @@ void memcached_free(memcached_st *ptr) if (ptr->continuum) libmemcached_free(ptr, ptr->continuum); - if (ptr->sasl) + if (ptr->sasl.callbacks) { #ifdef LIBMEMCACHED_WITH_SASL_SUPPORT memcached_destroy_sasl_auth_data(ptr); @@ -273,7 +274,7 @@ memcached_st *memcached_clone(memcached_st *clone, const memcached_st *source) } #ifdef LIBMEMCACHED_WITH_SASL_SUPPORT - if (source->sasl && source->sasl->callbacks) + if (source->sasl.callbacks) { if (memcached_clone_sasl(new_clone, source) != MEMCACHED_SUCCESS) { diff --git a/libmemcached/memcached.h b/libmemcached/memcached.h index 58f9f673..c099d76e 100644 --- a/libmemcached/memcached.h +++ b/libmemcached/memcached.h @@ -124,7 +124,7 @@ struct memcached_st { memcached_trigger_key_fn get_key_failure; memcached_trigger_delete_key_fn delete_trigger; memcached_callback_st *callbacks; - struct memcached_sasl_st *sasl; + struct memcached_sasl_st sasl; char prefix_key[MEMCACHED_PREFIX_KEY_MAX_SIZE]; struct { bool is_allocated:1; diff --git a/libmemcached/sasl.c b/libmemcached/sasl.c index f2e346a6..bdec4272 100644 --- a/libmemcached/sasl.c +++ b/libmemcached/sasl.c @@ -14,16 +14,13 @@ void memcached_set_sasl_callbacks(memcached_st *ptr, const sasl_callback_t *callbacks) { - ptr->sasl->callbacks= callbacks; - ptr->sasl->is_allocated= false; + ptr->sasl.callbacks= callbacks; + ptr->sasl.is_allocated= false; } const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr) { - if (ptr->sasl) - return ptr->sasl->callbacks; - - return NULL; + return ptr->sasl.callbacks; } /** @@ -119,7 +116,7 @@ memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *s sasl_conn_t *conn; int ret= sasl_client_new("memcached", server->hostname, laddr, raddr, - server->root->sasl->callbacks, 0, &conn); + server->root->sasl.callbacks, 0, &conn); if (ret != SASL_OK) { return MEMCACHED_AUTH_PROBLEM; @@ -144,12 +141,12 @@ memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *s do { /* send the packet */ - struct __write_vector_st vector[]= - { - { .length= sizeof(request.bytes), .buffer= request.bytes }, - { .length= keylen, .buffer= chosenmech }, - { .length= len, .buffer= data } - }; + struct __write_vector_st vector[]= + { + { .length= sizeof(request.bytes), .buffer= request.bytes }, + { .length= keylen, .buffer= chosenmech }, + { .length= len, .buffer= data } + }; if (memcached_io_writev(server, vector, 3, true) == -1) { @@ -221,7 +218,7 @@ memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, const char *password) { if (ptr == NULL || username == NULL || - password == NULL || ptr->sasl != NULL) + password == NULL || ptr->sasl.callbacks != NULL) { return MEMCACHED_FAILURE; } @@ -252,62 +249,52 @@ memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, cb[2].context= secret; cb[3].id= SASL_CB_LIST_END; - ptr->sasl->callbacks= cb; - ptr->sasl->is_allocated= true; + ptr->sasl.callbacks= cb; + ptr->sasl.is_allocated= true; return MEMCACHED_SUCCESS; } memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr) { - if (ptr == NULL || ptr->sasl->callbacks == NULL) + if (ptr == NULL || ptr->sasl.callbacks == NULL) { return MEMCACHED_FAILURE; } - if (ptr->sasl->is_allocated) + if (ptr->sasl.is_allocated) { - libmemcached_free(ptr, ptr->sasl->callbacks[0].context); - libmemcached_free(ptr, ptr->sasl->callbacks[2].context); - libmemcached_free(ptr, (void*)ptr->sasl->callbacks); - ptr->sasl->is_allocated= false; + libmemcached_free(ptr, ptr->sasl.callbacks[0].context); + libmemcached_free(ptr, ptr->sasl.callbacks[2].context); + libmemcached_free(ptr, (void*)ptr->sasl.callbacks); + ptr->sasl.is_allocated= false; } - ptr->sasl->callbacks= NULL; - libmemcached_free(ptr, ptr->sasl); - ptr->sasl= NULL; + ptr->sasl.callbacks= NULL; return MEMCACHED_SUCCESS; } memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcached_st *source) { - if (source->sasl == NULL) + + if (source->sasl.callbacks == NULL) { return MEMCACHED_SUCCESS; } - else - { - clone->sasl= libmemcached_malloc(source, sizeof(struct memcached_sasl_st)); - - if (clone->sasl == NULL) - { - return MEMCACHED_MEMORY_ALLOCATION_FAILURE; - } - } /* Hopefully we are using our own callback mechanisms.. */ - if (source->sasl->callbacks[0].id == SASL_CB_USER && - source->sasl->callbacks[0].proc == get_username && - source->sasl->callbacks[1].id == SASL_CB_AUTHNAME && - source->sasl->callbacks[1].proc == get_username && - source->sasl->callbacks[2].id == SASL_CB_PASS && - source->sasl->callbacks[2].proc == get_password && - source->sasl->callbacks[3].id == SASL_CB_LIST_END) + if (source->sasl.callbacks[0].id == SASL_CB_USER && + source->sasl.callbacks[0].proc == get_username && + source->sasl.callbacks[1].id == SASL_CB_AUTHNAME && + source->sasl.callbacks[1].proc == get_username && + source->sasl.callbacks[2].id == SASL_CB_PASS && + source->sasl.callbacks[2].proc == get_password && + source->sasl.callbacks[3].id == SASL_CB_LIST_END) { - sasl_secret_t *secret= source->sasl->callbacks[2].context; + sasl_secret_t *secret= source->sasl.callbacks[2].context; return memcached_set_sasl_auth_data(clone, - source->sasl->callbacks[0].context, + source->sasl.callbacks[0].context, (const char*)secret->data); } @@ -318,9 +305,9 @@ memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcached_st */ size_t total= 0; - while (source->sasl->callbacks[total].id != SASL_CB_LIST_END) + while (source->sasl.callbacks[total].id != SASL_CB_LIST_END) { - switch (source->sasl->callbacks[total].id) + switch (source->sasl.callbacks[total].id) { case SASL_CB_USER: case SASL_CB_AUTHNAME: @@ -339,38 +326,38 @@ memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcached_st { return MEMCACHED_MEMORY_ALLOCATION_FAILURE; } - memcpy(cb, source->sasl->callbacks, (total + 1) * sizeof(sasl_callback_t)); + memcpy(cb, source->sasl.callbacks, (total + 1) * sizeof(sasl_callback_t)); /* Now update the context... */ for (size_t x= 0; x < total; ++x) { if (cb[x].id == SASL_CB_USER || cb[x].id == SASL_CB_AUTHNAME) { - cb[x].context= libmemcached_malloc(clone, strlen(source->sasl->callbacks[x].context)); + cb[x].context= libmemcached_malloc(clone, strlen(source->sasl.callbacks[x].context)); if (cb[x].context == NULL) { /* Failed to allocate memory, clean up previously allocated memory */ for (size_t y= 0; y < x; ++y) { - libmemcached_free(clone, clone->sasl->callbacks[y].context); + libmemcached_free(clone, clone->sasl.callbacks[y].context); } libmemcached_free(clone, cb); return MEMCACHED_MEMORY_ALLOCATION_FAILURE; } - strcpy(cb[x].context, source->sasl->callbacks[x].context); + strcpy(cb[x].context, source->sasl.callbacks[x].context); } else { - sasl_secret_t *src = source->sasl->callbacks[x].context; + sasl_secret_t *src = source->sasl.callbacks[x].context; sasl_secret_t *n = libmemcached_malloc(clone, src->len + 1 + sizeof(*n)); if (n == NULL) { /* Failed to allocate memory, clean up previously allocated memory */ for (size_t y= 0; y < x; ++y) { - libmemcached_free(clone, clone->sasl->callbacks[y].context); + libmemcached_free(clone, clone->sasl.callbacks[y].context); } libmemcached_free(clone, cb); @@ -381,8 +368,8 @@ memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcached_st } } - clone->sasl->callbacks= cb; - clone->sasl->is_allocated= true; + clone->sasl.callbacks= cb; + clone->sasl.is_allocated= true; return MEMCACHED_SUCCESS; } -- 2.30.2 From c63b3f26c9e8d0214d3e1c70fb761f7700d61d2d Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Mon, 13 Sep 2010 14:26:17 +0200 Subject: [PATCH 10/16] Refactor: rename __write_vector_st Symbol names with double underscores generate a compile warning on some platforms causing a build break. Renamed to libmemcached_io_vector_st. --- libmemcached/auto.c | 6 +++--- libmemcached/delete.c | 4 ++-- libmemcached/do.c | 6 +++--- libmemcached/do.h | 4 ++-- libmemcached/get.c | 24 ++++++++++++------------ libmemcached/io.c | 2 +- libmemcached/io.h | 4 ++-- libmemcached/sasl.c | 2 +- libmemcached/stats.c | 6 +++--- libmemcached/storage.c | 8 ++++---- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/libmemcached/auto.c b/libmemcached/auto.c index b73425f0..ce2d0261 100644 --- a/libmemcached/auto.c +++ b/libmemcached/auto.c @@ -60,7 +60,7 @@ static memcached_return_t text_incr_decr(memcached_st *ptr, { *value= 0; rc= MEMCACHED_PROTOCOL_ERROR; - } + } else if (! strncmp(buffer, "CLIENT_ERROR\r\n", 14)) { *value= 0; @@ -116,12 +116,12 @@ static memcached_return_t binary_incr_decr(memcached_st *ptr, uint8_t cmd, request.message.body.initial= htonll(initial); request.message.body.expiration= htonl((uint32_t) expiration); - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length, .buffer= key } - }; + }; memcached_return_t rc; if ((rc= memcached_vdo(instance, vector, 3, true)) != MEMCACHED_SUCCESS) diff --git a/libmemcached/delete.c b/libmemcached/delete.c index 70553d94..84a34271 100644 --- a/libmemcached/delete.c +++ b/libmemcached/delete.c @@ -175,12 +175,12 @@ static inline memcached_return_t binary_delete(memcached_st *ptr, memcached_io_write(instance, NULL, 0, true); } - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes}, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length, .buffer= key }, - }; + }; memcached_return_t rc= MEMCACHED_SUCCESS; diff --git a/libmemcached/do.c b/libmemcached/do.c index 1a274cd3..14824a64 100644 --- a/libmemcached/do.c +++ b/libmemcached/do.c @@ -5,13 +5,13 @@ * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. * - * Summary: + * Summary: * */ #include "common.h" -memcached_return_t memcached_do(memcached_server_write_instance_st ptr, const void *command, +memcached_return_t memcached_do(memcached_server_write_instance_st ptr, const void *command, size_t command_length, bool with_flush) { memcached_return_t rc; @@ -51,7 +51,7 @@ memcached_return_t memcached_do(memcached_server_write_instance_st ptr, const vo } memcached_return_t memcached_vdo(memcached_server_write_instance_st ptr, - const struct __write_vector_st *vector, size_t count, + const struct libmemcached_io_vector_st *vector, size_t count, bool with_flush) { memcached_return_t rc; diff --git a/libmemcached/do.h b/libmemcached/do.h index d6d018d9..2506ddf2 100644 --- a/libmemcached/do.h +++ b/libmemcached/do.h @@ -17,14 +17,14 @@ extern "C" { #endif LIBMEMCACHED_LOCAL -memcached_return_t memcached_do(memcached_server_write_instance_st ptr, +memcached_return_t memcached_do(memcached_server_write_instance_st ptr, const void *commmand, size_t command_length, bool with_flush); LIBMEMCACHED_LOCAL memcached_return_t memcached_vdo(memcached_server_write_instance_st ptr, - const struct __write_vector_st *vector, size_t count, + const struct libmemcached_io_vector_st *vector, size_t count, bool with_flush); #ifdef __cplusplus diff --git a/libmemcached/get.c b/libmemcached/get.c index 55457f7f..8d76507c 100644 --- a/libmemcached/get.c +++ b/libmemcached/get.c @@ -1,5 +1,5 @@ /* LibMemcached - * Copyright (C) 2006-2009 Brian Aker + * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See @@ -227,13 +227,13 @@ static memcached_return_t memcached_mget_by_key_real(memcached_st *ptr, instance= memcached_server_instance_fetch(ptr, server_key); - struct __write_vector_st vector[]= - { - { .length= get_command_length, .buffer= get_command }, - { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, - { .length= key_length[x], .buffer= keys[x] }, - { .length= 1, .buffer= " " } - }; + struct libmemcached_io_vector_st vector[]= + { + { .length= get_command_length, .buffer= get_command }, + { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, + { .length= key_length[x], .buffer= keys[x] }, + { .length= 1, .buffer= " " } + }; if (memcached_server_response_count(instance) == 0) @@ -399,12 +399,12 @@ static memcached_return_t simple_binary_mget(memcached_st *ptr, request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES; request.message.header.request.bodylen= htonl((uint32_t)( key_length[x] + ptr->prefix_key_length)); - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length[x], .buffer= keys[x] } - }; + }; if (memcached_io_writev(instance, vector, 3, flush) == -1) { @@ -533,12 +533,12 @@ static memcached_return_t replication_binary_mget(memcached_st *ptr, * that we might have processed some of the responses etc. For now, * just make sure we work _correctly_ */ - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length[x], .buffer= keys[x] } - }; + }; if (memcached_io_writev(instance, vector, 3, true) == -1) { diff --git a/libmemcached/io.c b/libmemcached/io.c index 9a20609b..6513492d 100644 --- a/libmemcached/io.c +++ b/libmemcached/io.c @@ -440,7 +440,7 @@ ssize_t memcached_io_write(memcached_server_write_instance_st ptr, } ssize_t memcached_io_writev(memcached_server_write_instance_st ptr, - const struct __write_vector_st *vector, + const struct libmemcached_io_vector_st *vector, size_t number_of, bool with_flush) { ssize_t total= 0; diff --git a/libmemcached/io.h b/libmemcached/io.h index 30145823..9d5087e0 100644 --- a/libmemcached/io.h +++ b/libmemcached/io.h @@ -40,7 +40,7 @@ struct udp_datagram_header_st uint16_t reserved; }; -struct __write_vector_st +struct libmemcached_io_vector_st { size_t length; const void *buffer; @@ -48,7 +48,7 @@ struct __write_vector_st LIBMEMCACHED_LOCAL ssize_t memcached_io_writev(memcached_server_write_instance_st ptr, - const struct __write_vector_st *vector, + const struct libmemcached_io_vector_st *vector, size_t number_of, bool with_flush); LIBMEMCACHED_LOCAL diff --git a/libmemcached/sasl.c b/libmemcached/sasl.c index bdec4272..ef52c7c3 100644 --- a/libmemcached/sasl.c +++ b/libmemcached/sasl.c @@ -141,7 +141,7 @@ memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *s do { /* send the packet */ - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= keylen, .buffer= chosenmech }, diff --git a/libmemcached/stats.c b/libmemcached/stats.c index 731c1cc0..0c52d97a 100644 --- a/libmemcached/stats.c +++ b/libmemcached/stats.c @@ -258,11 +258,11 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat, request.message.header.request.keylen= htons((uint16_t)len); request.message.header.request.bodylen= htonl((uint32_t) len); - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= sizeof(request.bytes), .buffer= request.bytes }, { .length= len, .buffer= args } - }; + }; if (memcached_vdo(instance, vector, 2, true) != MEMCACHED_SUCCESS) { @@ -302,7 +302,7 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat, WATCHPOINT_ASSERT(0); } } - + if (check && check->func) { size_t key_length= strlen(buffer); diff --git a/libmemcached/storage.c b/libmemcached/storage.c index dce5fec3..25aaba30 100644 --- a/libmemcached/storage.c +++ b/libmemcached/storage.c @@ -155,12 +155,12 @@ static inline memcached_return_t memcached_send(memcached_st *ptr, } else { - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= write_length, .buffer= buffer }, { .length= value_length, .buffer= value }, { .length= 2, .buffer= "\r\n" } - }; + }; if (ptr->flags.buffer_requests && verb == SET_OP) { @@ -492,13 +492,13 @@ static memcached_return_t memcached_send_binary(memcached_st *ptr, } } - struct __write_vector_st vector[]= + struct libmemcached_io_vector_st vector[]= { { .length= send_length, .buffer= request.bytes }, { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, { .length= key_length, .buffer= key }, { .length= value_length, .buffer= value } - }; + }; /* write the header */ memcached_return_t rc; -- 2.30.2 From 19a3233e3e645a7f4db7822625a0f57337bffe37 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Mon, 13 Sep 2010 14:27:18 +0200 Subject: [PATCH 11/16] Don't include system headers within an extern C block --- libhashkit/common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libhashkit/common.h b/libhashkit/common.h index b2aaf0e2..dff3ab0b 100644 --- a/libhashkit/common.h +++ b/libhashkit/common.h @@ -9,10 +9,6 @@ #ifndef HASHKIT_COMMON_H #define HASHKIT_COMMON_H -#ifdef __cplusplus -extern "C" { -#endif - #include "config.h" #include @@ -23,6 +19,10 @@ extern "C" { #include "hashkit.h" +#ifdef __cplusplus +extern "C" { +#endif + HASHKIT_LOCAL void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result); -- 2.30.2 From 19afeb983282feb3308e0c60dc8da94a506cfe65 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Mon, 13 Sep 2010 14:31:19 +0200 Subject: [PATCH 12/16] Refactor: Renamed internal stack dump function Some compilers generate a warning for symbols starting with double underscores causing a build break. Renamed the function to libmemcached_stack_dump instead, and added an implementation for Solaris while I'm touching the code --- libmemcached/watchpoint.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/libmemcached/watchpoint.h b/libmemcached/watchpoint.h index 31d0a12b..fc25eb5c 100644 --- a/libmemcached/watchpoint.h +++ b/libmemcached/watchpoint.h @@ -16,7 +16,7 @@ #if defined(DEBUG) #ifdef TARGET_OS_LINUX -static inline void __stack_dump(void) +static inline void libmemcached_stack_dump(void) { void *array[10]; int size; @@ -35,12 +35,21 @@ static inline void __stack_dump(void) fflush(stderr); } +#elif defined(__sun) +#include + +static inline void libmemcached_stack_dump(void) +{ + fflush(stderr); + printstack(fileno(stderr)); +} + #else -static inline void __stack_dump(void) +static inline void libmemcached_stack_dump(void) { } -#endif // __stack_dump() +#endif // libmemcached_stack_dump() #include @@ -53,9 +62,9 @@ static inline void __stack_dump(void) #define WATCHPOINT_LABELED_NUMBER(A,B) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s:%zu\n", __FILE__, __LINE__,__func__,(A),(size_t)(B));fflush(stdout); } while (0) #define WATCHPOINT_IF_LABELED_NUMBER(A,B,C) do { if(A) {fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s:%zu\n", __FILE__, __LINE__,__func__,(B),(size_t)(C));fflush(stdout);} } while (0) #define WATCHPOINT_ERRNO(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout); } while (0) -#define WATCHPOINT_ASSERT_PRINT(A,B,C) do { if(!(A)){fprintf(stderr, "\nWATCHPOINT ASSERT %s:%d (%s) ", __FILE__, __LINE__,__func__);fprintf(stderr, (B),(C));fprintf(stderr,"\n");fflush(stdout); __stack_dump(); } assert((A)); } while (0) -#define WATCHPOINT_ASSERT(A) do { if (! (A)) {__stack_dump();} assert((A)); } while (0) -#define WATCHPOINT_ASSERT_INITIALIZED(A) do { if (! (A)) { __stack_dump(); } assert(memcached_is_initialized((A))); } while (0); +#define WATCHPOINT_ASSERT_PRINT(A,B,C) do { if(!(A)){fprintf(stderr, "\nWATCHPOINT ASSERT %s:%d (%s) ", __FILE__, __LINE__,__func__);fprintf(stderr, (B),(C));fprintf(stderr,"\n");fflush(stdout); libmemcached_stack_dump(); } assert((A)); } while (0) +#define WATCHPOINT_ASSERT(A) do { if (! (A)) {libmemcached_stack_dump();} assert((A)); } while (0) +#define WATCHPOINT_ASSERT_INITIALIZED(A) do { if (! (A)) { libmemcached_stack_dump(); } assert(memcached_is_initialized((A))); } while (0); #define WATCHPOINT_SET(A) do { A; } while(0); #else -- 2.30.2 From ab125a58ba37c005f5365b9e8fc68e9d0bfa8ce7 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Mon, 13 Sep 2010 21:51:40 +0200 Subject: [PATCH 13/16] Update libmemcached version number due to change of struct size --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e94862af..c848552d 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ PANDORA_CANONICAL_TARGET #shared library versioning MEMCACHED_UTIL_LIBRARY_VERSION=1:0:0 MEMCACHED_PROTOCAL_LIBRARY_VERSION=0:0:0 -MEMCACHED_LIBRARY_VERSION=5:1:0 +MEMCACHED_LIBRARY_VERSION=6:0:0 # | | | # +------+ | +---+ # | | | -- 2.30.2 From e17d20233058cc5a918c134669df0e81ee56640e Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Tue, 14 Sep 2010 09:55:39 +0200 Subject: [PATCH 14/16] Fixed dtrace enabled compilations --- .bzrignore | 1 + libmemcached/include.am | 2 +- tests/include.am | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.bzrignore b/.bzrignore index 0579973b..d7c41d0e 100644 --- a/.bzrignore +++ b/.bzrignore @@ -72,6 +72,7 @@ libmemcached-0.37-1.x86_64.rpm libmemcached-?.??/ libmemcached.pop libmemcached/configure.h +libmemcached/dtrace_probes.h libmemcached/memcached_configure.h libmemcached_examples.pop libmemcachedutil.pop diff --git a/libmemcached/include.am b/libmemcached/include.am index fccced99..c348cb3d 100644 --- a/libmemcached/include.am +++ b/libmemcached/include.am @@ -172,5 +172,5 @@ libmemcached/dtrace_probes.h: libmemcached/libmemcached_probes.d libmemcached/libmemcached_probes.o: libmemcached/libmemcached_probes.d ${libmemcached_libmemcached_la_OBJECTS} config.h .d.o: - $(DTRACE) $(DTRACEFLAGS) -o libmemcached/libmemcached_probes.o -G -s ${top_srcdir}/libmemcached/libmemcached_probes.d `grep '^pic_object' ${top_builddir}/libmemcached/*.lo | cut -f 2 -d\' | sed "s/^/${top_builddir}\//"` + $(DTRACE) $(DTRACEFLAGS) -o libmemcached/libmemcached_probes.o -G -s ${top_srcdir}/libmemcached/libmemcached_probes.d `grep '^pic_object' ${top_builddir}/libmemcached/*.lo | cut -f 2 -d\' | sed "s/^/${top_builddir}\/libmemcached\//"` diff --git a/tests/include.am b/tests/include.am index 7a9c2062..6c77927d 100644 --- a/tests/include.am +++ b/tests/include.am @@ -47,7 +47,11 @@ tests_testapp_DEPENDENCIES= \ tests/libtest.la \ libmemcached/libmemcachedinternal.la \ $(TESTS_LDADDS) -tests_testapp_LDADD= $(tests_testapp_DEPENDENCIES) $(LIBSASL) +tests_testapp_LDADD= clients/libgenexec.la \ + tests/libserver.la \ + tests/libtest.la \ + libmemcached/libmemcachedinternal.la \ + $(TESTS_LDADDS) $(LIBSASL) tests_testplus_SOURCES= tests/plus.cpp tests_testplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX) -- 2.30.2 From 89fb1b4a9c113ae402a3270e3ac874fd30b4a0a8 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Wed, 15 Sep 2010 11:38:26 -0700 Subject: [PATCH 15/16] Fix for rpm build --- support/libmemcached.spec.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/libmemcached.spec.in b/support/libmemcached.spec.in index 6b022b43..ee9f20f9 100644 --- a/support/libmemcached.spec.in +++ b/support/libmemcached.spec.in @@ -83,11 +83,11 @@ you will need to install %{name}-devel. %exclude %{_libdir}/libmemcachedutil.la %exclude %{_libdir}/libmemcachedprotocol.la %{_libdir}/libhashkit.so.0.0.0 -%{_libdir}/libmemcached.so.5.0.2 +%{_libdir}/libmemcached.so.6.0.0 %{_libdir}/libmemcachedutil.so.1.0.0 %{_libdir}/libmemcachedprotocol.so.0.0.0 %{_libdir}/libhashkit.so.0 -%{_libdir}/libmemcached.so.5 +%{_libdir}/libmemcached.so.6 %{_libdir}/libmemcachedprotocol.so.0 %{_libdir}/libmemcachedutil.so.1 %{_mandir}/man1/memcapable.1.gz -- 2.30.2 From d965b66f6ca34c32ef7691f0d53717f353bc24e5 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Wed, 22 Sep 2010 22:00:27 -0700 Subject: [PATCH 16/16] Updates for 0.44 release --- ChangeLog | 6 ++++++ configure.ac | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 913e9a0a..86b35457 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +0.44 Wed Sep 22 21:57:57 PDT 2010 + * Windows bug fixes. + * Hudson port support in test harness. + * Improved portability of test hanrness. + * SASL fixes. + 0.43 Wed Jul 28 16:29:47 PDT 2010 * Added --args to memstat so that a greater range of values can be returned. * Prelimanary support for Windows. diff --git a/configure.ac b/configure.ac index 4137fb4d..379466df 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ # the COPYING file in this directory for full text. AC_PREREQ(2.59) -AC_INIT([libmemcached],[0.43],[http://libmemcached.org/]) +AC_INIT([libmemcached],[0.44],[http://libmemcached.org/]) AC_CONFIG_SRCDIR([libmemcached/memcached.c]) AC_CONFIG_AUX_DIR(config) -- 2.30.2