From: Brian Aker Date: Mon, 28 Nov 2011 05:05:08 +0000 (-0800) Subject: Correction for UDP code in ascii mode. X-Git-Tag: 1.0.3~4^2~3^2~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=5ed5a750b9ae6e4e577232ecf50dc333eb414298;p=awesomized%2Flibmemcached Correction for UDP code in ascii mode. --- diff --git a/libmemcached/storage.cc b/libmemcached/storage.cc index f3616251..89bc8e87 100644 --- a/libmemcached/storage.cc +++ b/libmemcached/storage.cc @@ -276,7 +276,7 @@ static memcached_return_t memcached_send_ascii(memcached_st *ptr, WATCHPOINT_ASSERT(write_length < MEMCACHED_DEFAULT_COMMAND_SIZE); } - if (ptr->flags.use_udp and ptr->flags.buffer_requests) + if (ptr->flags.use_udp) { size_t cmd_size= write_length + value_length +2; if (cmd_size > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH) diff --git a/tests/libmemcached_world.h b/tests/libmemcached_world.h index 09000c36..ad55d17c 100644 --- a/tests/libmemcached_world.h +++ b/tests/libmemcached_world.h @@ -48,7 +48,6 @@ static void *world_create(server_startup_st& servers, test_return_t& error) return NULL; } - in_port_t max_port= TEST_PORT_BASE; for (uint32_t x= 0; x < servers.count(); x++) { diff --git a/tests/mem_functions.cc b/tests/mem_functions.cc index ce352609..c2fbdc32 100644 --- a/tests/mem_functions.cc +++ b/tests/mem_functions.cc @@ -3122,17 +3122,16 @@ static test_return_t generate_data(memcached_st *memc) static test_return_t generate_data_with_stats(memcached_st *memc) { - uint32_t host_index= 0; unsigned int check_execute= execute_set(memc, global_pairs, global_count); - test_true(check_execute == global_count); + test_compare(check_execute, global_count); // @todo hosts used size stats memcached_return_t rc; memcached_stat_st *stat_p= memcached_stat(memc, NULL, &rc); test_true(stat_p); - for (host_index= 0; host_index < SERVERS_TO_CREATE; host_index++) + for (uint32_t host_index= 0; host_index < SERVERS_TO_CREATE; host_index++) { /* This test was changes so that "make test" would work properlly */ if (DEBUG) diff --git a/tests/mem_udp.cc b/tests/mem_udp.cc index fc469bae..16fc1c73 100644 --- a/tests/mem_udp.cc +++ b/tests/mem_udp.cc @@ -180,6 +180,7 @@ static test_return_t udp_set_test(memcached_st *memc) Expected expected_ids; get_udp_request_ids(memc, expected_ids); unsigned int server_key= memcached_generate_hash(memc, test_literal_param("foo")); + test_true(server_key < memcached_server_count(memc)); memcached_server_instance_st instance= memcached_server_instance_by_position(memc, server_key); size_t init_offset= instance->write_buffer_offset; @@ -453,7 +454,7 @@ collection_st collection[] ={ }; #define TEST_PORT_BASE MEMCACHED_DEFAULT_PORT +10 -#include "libmemcached_world.h" +#include "tests/libmemcached_world.h" void get_world(Framework *world) { diff --git a/tests/plus.cpp b/tests/plus.cpp index 7de8164f..5078f1f5 100644 --- a/tests/plus.cpp +++ b/tests/plus.cpp @@ -282,7 +282,7 @@ collection_st collection[] ={ #define SERVERS_TO_CREATE 5 #define TEST_PORT_BASE MEMCACHED_DEFAULT_PORT +10 -#include "libmemcached_world.h" +#include "tests/libmemcached_world.h" void get_world(Framework *world) {