Merge from build tree.
authorBrian Aker <brian@tangent.org>
Mon, 13 Aug 2012 15:58:16 +0000 (11:58 -0400)
committerBrian Aker <brian@tangent.org>
Mon, 13 Aug 2012 15:58:16 +0000 (11:58 -0400)
234 files changed:
Makefile.am
config/autorun.sh
configure.ac
docs/conf.py.in
docs/man/hashkit_clone.3
docs/man/hashkit_crc32.3
docs/man/hashkit_create.3
docs/man/hashkit_fnv1_32.3
docs/man/hashkit_fnv1_64.3
docs/man/hashkit_fnv1a_32.3
docs/man/hashkit_fnv1a_64.3
docs/man/hashkit_free.3
docs/man/hashkit_functions.3
docs/man/hashkit_hsieh.3
docs/man/hashkit_is_allocated.3
docs/man/hashkit_jenkins.3
docs/man/hashkit_md5.3
docs/man/hashkit_murmur.3
docs/man/hashkit_value.3
docs/man/libhashkit.3
docs/man/libmemcached.3
docs/man/libmemcached_check_configuration.3
docs/man/libmemcached_configuration.3
docs/man/libmemcached_examples.3
docs/man/libmemcachedutil.3
docs/man/memaslap.1
docs/man/memcached.3
docs/man/memcached_add.3
docs/man/memcached_add_by_key.3
docs/man/memcached_analyze.3
docs/man/memcached_append.3
docs/man/memcached_append_by_key.3
docs/man/memcached_auto.3
docs/man/memcached_behavior.3
docs/man/memcached_behavior_get.3
docs/man/memcached_behavior_set.3
docs/man/memcached_callback.3
docs/man/memcached_callback_get.3
docs/man/memcached_callback_set.3
docs/man/memcached_cas.3
docs/man/memcached_cas_by_key.3
docs/man/memcached_clone.3
docs/man/memcached_create.3
docs/man/memcached_decrement.3
docs/man/memcached_decrement_with_initial.3
docs/man/memcached_delete.3
docs/man/memcached_delete_by_key.3
docs/man/memcached_destroy_sasl_auth_data.3
docs/man/memcached_dump.3
docs/man/memcached_exist.3
docs/man/memcached_exist_by_key.3
docs/man/memcached_fetch.3
docs/man/memcached_fetch_execute.3
docs/man/memcached_fetch_result.3
docs/man/memcached_flush.3
docs/man/memcached_flush_buffers.3
docs/man/memcached_free.3
docs/man/memcached_generate_hash.3
docs/man/memcached_generate_hash_value.3
docs/man/memcached_get.3
docs/man/memcached_get_by_key.3
docs/man/memcached_get_memory_allocators.3
docs/man/memcached_get_sasl_callbacks.3
docs/man/memcached_get_user_data.3
docs/man/memcached_increment.3
docs/man/memcached_increment_with_initial.3
docs/man/memcached_last_error_message.3
docs/man/memcached_lib_version.3
docs/man/memcached_memory_allocators.3
docs/man/memcached_mget.3
docs/man/memcached_mget_by_key.3
docs/man/memcached_mget_execute.3
docs/man/memcached_mget_execute_by_key.3
docs/man/memcached_pool.3
docs/man/memcached_pool_behavior_get.3
docs/man/memcached_pool_behavior_set.3
docs/man/memcached_pool_create.3
docs/man/memcached_pool_destroy.3
docs/man/memcached_pool_fetch.3
docs/man/memcached_pool_pop.3
docs/man/memcached_pool_push.3
docs/man/memcached_pool_release.3
docs/man/memcached_pool_st.3
docs/man/memcached_prepend.3
docs/man/memcached_prepend_by_key.3
docs/man/memcached_quit.3
docs/man/memcached_replace.3
docs/man/memcached_replace_by_key.3
docs/man/memcached_result_cas.3
docs/man/memcached_result_create.3
docs/man/memcached_result_flags.3
docs/man/memcached_result_free.3
docs/man/memcached_result_key_length.3
docs/man/memcached_result_key_value.3
docs/man/memcached_result_length.3
docs/man/memcached_result_st.3
docs/man/memcached_result_value.3
docs/man/memcached_return_t.3
docs/man/memcached_sasl.3
docs/man/memcached_sasl_set_auth_data.3
docs/man/memcached_server_add.3
docs/man/memcached_server_add_unix_socket.3
docs/man/memcached_server_count.3
docs/man/memcached_server_cursor.3
docs/man/memcached_server_list.3
docs/man/memcached_server_list_append.3
docs/man/memcached_server_list_count.3
docs/man/memcached_server_list_free.3
docs/man/memcached_server_push.3
docs/man/memcached_server_st.3
docs/man/memcached_servers.3
docs/man/memcached_servers_parse.3
docs/man/memcached_servers_reset.3
docs/man/memcached_set.3
docs/man/memcached_set_by_key.3
docs/man/memcached_set_encoding_key.3
docs/man/memcached_set_memory_allocators.3
docs/man/memcached_set_memory_allocators_context.3
docs/man/memcached_set_sasl_callbacks.3
docs/man/memcached_set_user_data.3
docs/man/memcached_stat.3
docs/man/memcached_stat_execute.3
docs/man/memcached_stat_get_keys.3
docs/man/memcached_stat_get_value.3
docs/man/memcached_stat_servername.3
docs/man/memcached_stats.3
docs/man/memcached_strerror.3
docs/man/memcached_touch.3
docs/man/memcached_touch_by_key.3
docs/man/memcached_user_data.3
docs/man/memcached_verbosity.3
docs/man/memcached_version.3
docs/man/memcapable.1
docs/man/memcat.1
docs/man/memcp.1
docs/man/memdump.1
docs/man/memerror.1
docs/man/memexist.1
docs/man/memflush.1
docs/man/memparse.1
docs/man/memping.1
docs/man/memrm.1
docs/man/memslap.1
docs/man/memstat.1
docs/man/memtouch.1
example/t/memcached_light.cc
libmemcached-1.0/struct/memcached.h
libmemcached/connect.cc
libmemcached/csl/context.h
libmemcached/memcached.cc
libtest/cmdline.cc
libtest/cmdline.h
libtest/collection.cc
libtest/collection.h
libtest/common.h
libtest/drizzled.cc
libtest/fatal.cc
libtest/fatal.hpp
libtest/formatter.cc [new file with mode: 0644]
libtest/formatter.hpp [new file with mode: 0644]
libtest/framework.cc
libtest/framework.h
libtest/gearmand.cc
libtest/get.h
libtest/has.cc
libtest/http.cc
libtest/http.hpp
libtest/include.am
libtest/main.cc
libtest/memcached.cc
libtest/port.h
libtest/server.cc
libtest/server_container.cc
libtest/skiptest.cc
libtest/test.h
libtest/unittest.cc
m4/README.md [new file with mode: 0644]
m4/ax_append_compile_flags.m4 [new file with mode: 0644]
m4/ax_append_flag.m4 [new file with mode: 0644]
m4/ax_append_link_flags.m4 [new file with mode: 0644]
m4/ax_check_compile_flag.m4 [new file with mode: 0644]
m4/ax_check_link_flag.m4 [new file with mode: 0644]
m4/ax_harden_compiler_flags.m4 [new file with mode: 0644]
m4/include.am [new file with mode: 0644]
memcached/README [deleted file]
memcached/README.md [new file with mode: 0644]
memcached/assoc.c
memcached/autogen.sh
memcached/cache.c
memcached/daemon.c
memcached/devtools/clean-whitespace.pl
memcached/doc/protocol.txt
memcached/hash.c
memcached/items.c
memcached/memcached.c
memcached/memcached.h
memcached/memcached.spec.in
memcached/memcached_dtrace.d
memcached/slabs.c
memcached/slabs.h
memcached/t/binary.t
memcached/t/slabs_reassign.t
memcached/t/whitespace.t
memcached/testapp.c
memcached/thread.c
memcached/util.c
memcached/version.m4 [deleted file]
support/libmemcached.spec.in
tests/cycle.cc
tests/failure.cc
tests/hash_plus.cc
tests/hashkit_functions.cc
tests/libmemcached-1.0/all_tests.cc
tests/libmemcached-1.0/all_tests_socket.cc
tests/libmemcached-1.0/atomsmasher.cc
tests/libmemcached-1.0/internals.cc
tests/libmemcached-1.0/mem_functions.cc
tests/libmemcached-1.0/plus.cpp
tests/libmemcached-1.0/sasl.cc
tests/libmemcached_world.h
tests/libmemcached_world_socket.h
tests/mem_udp.cc
tests/memcapable.cc
tests/memcat.cc
tests/memcp.cc
tests/memdump.cc
tests/memerror.cc
tests/memexist.cc
tests/memflush.cc
tests/memrm.cc
tests/memslap.cc
tests/memstat.cc
tests/memtouch.cc
tests/parser.cc

index a548c9823be72f5bf9934a332cb0399c2444529e..e64231fe030ce35f3f2797b7c93592738bee31bd 100644 (file)
@@ -52,6 +52,8 @@ include tests/include.am
 include util/include.am
 include win32/include.am
 
+include m4/include.am
+
 if HAVE_LIBEVENT
 include memcached/include.am
 libtest_libtest_la_DEPENDENCIES+= memcached/memcached
@@ -67,9 +69,10 @@ merge-clean:
        @find ./ | $(GREP) \.gcda | xargs rm -f
        @find ./ | $(GREP) \.gcno | xargs rm -f
        @find ./ | $(GREP) \.gz | xargs rm -f
-       @find ./ | $(GREP) \.orig | xargs rm -f
+       @find ./ | $(GREP) \.moved | xargs rm -r -f
+       @find ./ | $(GREP) \\.orig | xargs rm -f
        @find ./ | $(GREP) \.rej | xargs rm -f
-       @find ./ | $(GREP) \.rpm | xargs rm -f
+       @rm -f *\.rpm
        @find ./ | $(GREP) \.THIS | xargs rm -f
        @find ./ | $(GREP) \.OTHER | xargs rm -f
        @find ./ | $(GREP) \.BASE | xargs rm -f
index c7e87ed1b8c8611cb7fe244d775a1b264167445f..ed08d182f2a0823bc637439ec7e21b06d780d627 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-#  Copyright (C) 2011 Brian Aker
+#  Copyright (C) 2011 Brian Aker, brian@tangent.org
 #  All rights reserved.
 # 
 #  Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@ locate_binary() {
 }
 
 
-AUTORECONF_FLAGS=" --install --force --verbose -Wall"
+AUTORECONF_FLAGS=" --install --verbose -Wall"
 
 if test -f config/pre_hook.sh
 then
index c2e737330aa3a3cbdd7fe74f21e1648cee6cd5f0..eeaccd8244835fb81d6875178d3a6160d50a5168 100644 (file)
@@ -69,7 +69,6 @@ m4_include([libtest/yatl.m4])
 m4_include([m4/memcached_sasl.m4])
 m4_include([m4/gearmand.m4])
 m4_include([m4/libgearman.m4])
-m4_include([memcached/version.m4])
 
 AM_CONDITIONAL(BUILDING_LIBMEMCACHED, true)
 AM_CONDITIONAL(HAVE_LIBMEMCACHED, false)
@@ -81,17 +80,7 @@ AM_CONDITIONAL(BUILDING_GEARMAN, false)
 AC_SEARCH_LIBS(getopt_long, gnugetopt)
 AC_SEARCH_LIBS(gethostbyname, nsl)
 
-case "$target_os" in
-  *linux*)
-       AS_IF([test "x$GCC" = "xyes"],
-             [
-              LDFLAGS="$LDFLAGS -z relro -z now"
-              ])
-   ;;
-   esac
-
 dnl Specialty checks
-AX_PTHREAD
 AX_CXX_CINTTYPES
 CONFIG_EXTRA
 DETECT_BYTEORDER
@@ -104,6 +93,7 @@ PROTOCOL_BINARY_TEST
 ENABLE_DEPRECATED
 
 AC_CHECK_FUNCS([alarm])
+AC_CHECK_FUNCS([clock_gettime])
 AC_CHECK_FUNCS([dup2])
 AC_CHECK_FUNCS([getline])
 AC_CHECK_FUNCS([gettimeofday])
@@ -296,6 +286,9 @@ fi
 AX_CHECK_SOCK_CLOEXEC([AC_DEFINE([HAVE_SOCK_CLOEXEC], [1], [Check for SOCK_CLOEXEC.])],
                        [AC_DEFINE([HAVE_SOCK_CLOEXEC], [0], [Check for SOCK_CLOEXEC.])])
 
+AX_HARDEN_COMPILER_FLAGS
+AX_PTHREAD
+
 AC_CONFIG_FILES([
   Makefile
   docs/conf.py
index c5ab0d746e6cf645f997c0b64e650c719d5cacf2..9f0b2a32b49744832b2fb67bcf7684cf7e0896e5 100644 (file)
@@ -27,11 +27,11 @@ import sys, os
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = []
 
-extensions = ['sphinxcontrib.googleanalytics']
+#extensions = ['sphinxcontrib.googleanalytics']
 
 # Google 
-googleanalytics_id = 'UA-15307604-2'
-googleanalytics_enabled = 'True'
+#googleanalytics_id = 'UA-15307604-2'
+#googleanalytics_enabled = 'True'
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
@@ -47,7 +47,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'libmemcached'
-copyright = u'2011, Brian Aker DataDifferential, http://datadifferential.com/'
+copyright = u'2011-2012, Brian Aker DataDifferential, http://datadifferential.com/'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
index ff975c52b17d6382a516a27fcd79413f44745aab..a6f6b6bc2074d5b1be7e6372d42280563828d092 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_CLONE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_CLONE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_clone \- libhashkit Documentation
 .
index 7863dc19719f95f49d8fdc6321878755f493703e..cc211631537b226a5843a4a43ce759223d6b93d8 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_CRC32" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_CRC32" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_crc32 \- libhashkit Documentation
 .
index 2b5ead13db9506d0203ef5486f5531605bac3ed0..d75e60efd6168d8760ba3bae9c78c1e4b2b9b49c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_CREATE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_CREATE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_create \- libhashkit Documentation
 .
index 5564add7da856cde39cae5fc73f62d1392adb84f..058dab1d7ed40d0fb64cc6f5fb63cad3fa7cda7b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_FNV1_32" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_FNV1_32" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_fnv1_32 \- libhashkit Documentation
 .
index 469319af0a554c15c246ffd7aa0838a124c342a4..29e21b053e49299cffb16c62a6f56d464b57c97b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_FNV1_64" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_FNV1_64" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_fnv1_64 \- libhashkit Documentation
 .
index adaf912e03fda1ae9ca6b5c4fcd708a5aa983e70..f30281ad1e46e3a4a91623d6da13f75a4bdbd24c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_FNV1A_32" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_FNV1A_32" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_fnv1a_32 \- libhashkit Documentation
 .
index c1b97476209b8fb55a771c57e1df31d1ab1771a3..692208a3ec271e6db6f2f20a75108e4b824d55bd 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_FNV1A_64" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_FNV1A_64" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_fnv1a_64 \- libhashkit Documentation
 .
index f2f289f18d219448871614ff637b3ad490d13f12..0d48b15a99cebf6d88e5edad0fe9bef29f35876f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_FREE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_FREE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_free \- libhashkit Documentation
 .
index bbf9043706ff26a53958596365389dc75b6ed862..318628cfb381b2b3a56bdae8e435c3a0d5105635 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_FUNCTIONS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_FUNCTIONS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_functions \- libhashkit Documentation
 .
index 7c90c3dc85b2652734ad3c13e92c44a1f5ab2c1e..5cc8d369a7fb10755849ce24fb6e325d87c0a2ad 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_HSIEH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_HSIEH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_hsieh \- libhashkit Documentation
 .
index a9f3ca5f4d8c1fba2f15293e5f7a26bce79ef240..d0d67031a0e5455b9bb9375162d76b648916b984 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_IS_ALLOCATED" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_IS_ALLOCATED" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_is_allocated \- libhashkit Documentation
 .
index d14ab25e10703a7be6612e4e73bfd94b228f394a..8e142577d6118c008ff01fed9115ab9d830e7e03 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_JENKINS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_JENKINS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_jenkins \- libhashkit Documentation
 .
index 56b75f99d140c0e997048ebb54917a1b80475358..011e065de68a8eb42e76dea875b5784f783083b8 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_MD5" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_MD5" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_md5 \- libhashkit Documentation
 .
index 9f36b22ac80ea8cf6449d794272e1098b3027a89..ca2dd686d5983e92bf92389d9e3b35fe472a86c6 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_MURMUR" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_MURMUR" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_murmur \- libhashkit Documentation
 .
index 05fbe1e3a97e2ec2e840c9b59f22edaea65ab435..e542bb0ce7e1a5bf89ccd921ac728ddf7616e692 100644 (file)
@@ -1,4 +1,4 @@
-.TH "HASHKIT_VALUE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "HASHKIT_VALUE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 hashkit_value \- libhashkit Documentation
 .
index 20b6cf4a2754a4c9e6e36cecc6be283f76c04718..e26604a1bdb5ed2d22ef16dc514149a52c92d0bf 100644 (file)
@@ -1,4 +1,4 @@
-.TH "LIBHASHKIT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "LIBHASHKIT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 libhashkit \- libhashkit Documentation
 .
index f3498b87983a6485c0e9ff664350828f81fc150b..ff1edc29b57637025320e4babd57b63e81e51d52 100644 (file)
@@ -1,4 +1,4 @@
-.TH "LIBMEMCACHED" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "LIBMEMCACHED" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 libmemcached \- Introducing the C Client Library for memcached
 .
index 0953fe9822f3aa9e9a330d7fac103d335de68759..9f118b1abd46386fe2986590fbc593df74dc06d5 100644 (file)
@@ -1,4 +1,4 @@
-.TH "LIBMEMCACHED_CHECK_CONFIGURATION" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "LIBMEMCACHED_CHECK_CONFIGURATION" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 libmemcached_check_configuration \- libmemcached Documentation
 .
index 6d5a9a1debadf87afbda3fad415d710160e20905..ca851575302c127a8b831eea174c8b8ee52541db 100644 (file)
@@ -1,4 +1,4 @@
-.TH "LIBMEMCACHED_CONFIGURATION" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "LIBMEMCACHED_CONFIGURATION" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 libmemcached_configuration \- libmemcached Documentation
 .
index 9a310fce1158395105f7416aeec2aced955317ee..a08e625d2cb5d550810de9d11a8decddf90052f8 100644 (file)
@@ -1,4 +1,4 @@
-.TH "LIBMEMCACHED_EXAMPLES" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "LIBMEMCACHED_EXAMPLES" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 libmemcached_examples \- libmemcached Documentation
 .
index d3a1852f2200b9e64f9fda28f4c8f7308d3be6bf..675e71ed795177fe21e2a3195ff73f4d32570511 100644 (file)
@@ -1,4 +1,4 @@
-.TH "LIBMEMCACHEDUTIL" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "LIBMEMCACHEDUTIL" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 libmemcachedutil \- libmemcached Documentation
 .
index c395258de1d50f242c5b6a17314a99bc480a6365..e37f17860815d4556279cbaa7c9afb3b25d15da7 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMASLAP" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMASLAP" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memaslap \- libmemcached Documentation
 .
index 543a288feabee78313324885c3f62b433c7ec70c..73b8c6d02028b60d37f3511e43ba80e41aed4101 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached \- libmemcached Documentation
 .
index 95e46332c7ec1a39181177f4d60ee3eabf9b5413..a20248a505922d28319bb01572c5e817a75401ab 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_ADD" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_ADD" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_add \- Storing and Replacing Data
 .
index 3291daad141c62ffcc7208fc01d8f567e239e2d9..ea5d6b6754a79c3414ef5c9852eaf37b7119641e 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_ADD_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_ADD_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_add_by_key \- Storing and Replacing Data
 .
index 52a0348f6a0ff852747c6647f1bc94264bd2e25c..bafd5f98c6644928b28b171d9a1c078bcc5550db 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_ANALYZE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_ANALYZE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_analyze \- libmemcached Documentation
 .
index 9ad00c8f95eca7b7f3ee0258efe1d1f09f0e66f6..828c4de36b4780e1f8f66615e9ed00ca340ab7df 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_APPEND" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_APPEND" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_append \- Appending to or Prepending to data on the server
 .
index 64fbc194e6645356147e3afce177b80ae4f584ab..df672948d97708a180ed3d9f3df789945df0b1eb 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_APPEND_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_APPEND_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_append_by_key \- Appending to or Prepending to data on the server
 .
index ca105159ad3f554d745802d4e466cb01a320e465..2d0004ab0026e318ee60cf17ac5578dc3a120624 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_AUTO" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_AUTO" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_auto \- Incrementing and Decrementing Values
 .
index 2ebd1b9547456086a141d2c15fd1cbc63d09b5b0..d26cbb6eb7bcf95c0f6e22a21a0d84b00c04d946 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_BEHAVIOR" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_behavior \- libmemcached Documentation
 .
index 7de46afed59aa43ca6d89d1cc00d76d43fa9f972..f92394cfdc98697340b40d962f191fa4f1980298 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_BEHAVIOR_GET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR_GET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_behavior_get \- libmemcached Documentation
 .
index bf8ef2f54de9e2988c275c5e1c9787dc8608e77a..33b8ff06b63f72287ff90ea4d2a17ff98f99bd0d 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_BEHAVIOR_SET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR_SET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_behavior_set \- libmemcached Documentation
 .
index 32429fb6b2631a8ddc6b00c34f38a14f78816762..8384ebb32ca9fb1d22b94b40809a6b7eeaab1cb2 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_CALLBACK" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_CALLBACK" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_callback \- libmemcached Documentation
 .
index abd8a4629d6b90f3ddb0223a83b35d35a677c2ed..49fd09673dd17990791a371af19f8c5f184a2ccc 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_CALLBACK_GET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_CALLBACK_GET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_callback_get \- libmemcached Documentation
 .
index 608df40ed27d78f577211204abecd9fd908507df..e4a418ec3aed89c5ae035f5e4288163f970b713d 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_CALLBACK_SET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_CALLBACK_SET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_callback_set \- libmemcached Documentation
 .
index 34c262d00d16dcd1d387f629d7bb35f9dd2bb2ba..75f2c5067502a49864923625db172f5157542684 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_CAS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_CAS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_cas \- Working with data on the server in an atomic fashion
 .
index 5f1bd2c3670acb581e8a109904e4c396c9782d26..5a4c545bca359bf4a6a66dd5a1ea4db2e9140244 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_CAS_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_CAS_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_cas_by_key \- Storing and Replacing Data
 .
index 58ff91dee70b064e97006354d671894e87e9f990..6c679f0201a15fbd6a343707004b7e4f93c57dc3 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_CLONE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_CLONE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_clone \- libmemcached Documentation
 .
index 6ae829ad2e7ae7a5e6c1d05429e0b3034198c43d..7aa5c44d392fb6caca7287f927154110454a72ce 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_CREATE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_CREATE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_create \- libmemcached Documentation
 .
index 34344e655849a39327573387fa0e9d28e3b32d22..8db2e3802e0eb7157421456d72b09b3146f97f35 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_DECREMENT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_DECREMENT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_decrement \- Incrementing and Decrementing Values
 .
index bb2999eac5931add4748bcf5fc99188e743d6f34..dcba8ab95664e10cfbcfa92faef4bdd5df365b10 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_DECREMENT_WITH_INITIAL" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_DECREMENT_WITH_INITIAL" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_decrement_with_initial \- Incrementing and Decrementing Values
 .
index e4a3265ff2bcc9f46b04d8abab922c734b680474..8017b01127ab7df04f9d1f87268a02bc4b15549c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_DELETE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_DELETE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_delete \- libmemcached Documentation
 .
index caede555cdadfd3ebd13bc8b203f313a8fa7f3df..e85410b3aaffd584eafed850482a9e72be8c0ddd 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_DELETE_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_DELETE_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_delete_by_key \- libmemcached Documentation
 .
index dc6812d152f9c231c6d52af54e198dc39b2c22a1..aa5ad6cf3928b857268f82c291f90b6d95989994 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_DESTROY_SASL_AUTH_DATA" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_DESTROY_SASL_AUTH_DATA" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_destroy_sasl_auth_data \- libmemcached Documentation
 .
index 409756664553edda47fedd304ba5147fb8f14e89..c7f1ad64d081e5bce3fc763b8033cb10dcaf0bea 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_DUMP" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_DUMP" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_dump \- libmemcached Documentation
 .
index e8ddd1b05e812104eeec98fefc1ede5ae5ac2241..13bb7682df92ac450147c273062ba5b7def2dce4 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_EXIST" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_EXIST" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_exist \- libmemcached Documentation
 .
index dd1c6b53f22dc1703d75aba0aa4e0403d993fe58..2dc88b5aba651b2b130b717fc8ccc1e82d9c68cc 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_EXIST_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_EXIST_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_exist_by_key \- libmemcached Documentation
 .
index d1e433571e6cdcd459020ec11ec5fd3c65023ecf..e9a2a1c974e46482fb6d17651e191e4786e2c08e 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_FETCH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_FETCH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_fetch \- Retrieving data from the server
 .
index 130b4fdc3c79ca10938d534571f0acf8c76e6c5c..aa8fbb3300633150d2394998d0c63569004d094b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_FETCH_EXECUTE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_FETCH_EXECUTE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_fetch_execute \- Retrieving data from the server
 .
index 2264ba82d0300d90158474d9d34a1ff946eebc3d..6d0c0e7bee2dee119cd85d83969e2d33a58c18cb 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_FETCH_RESULT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_FETCH_RESULT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_fetch_result \- Retrieving data from the server
 .
index f0ce46d8b752abc183e8fcaf658bbfb50d6e99ae..9b64ac47bb0aecbb797bb7679c4f2683befed4c9 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_FLUSH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_FLUSH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_flush \- libmemcached Documentation
 .
index 60f78ad4dbe6ecafa1ad413ac9bf24545e6b77ee..71a1ad864ac4c9a617baa6d4e8a8d7bbfc689cda 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_FLUSH_BUFFERS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_FLUSH_BUFFERS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_flush_buffers \- libmemcached Documentation
 .
index b42771e4a4973563dfea9a39f1a273ed107d0531..42bb6e39c1c0ad2b079f48bca097c6ef71654686 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_FREE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_FREE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_free \- libmemcached Documentation
 .
index 0b397e1d08e0390bb9163416ad69aeefa0631f6c..43782b6e2af0db274a1a05ae3ca5ce62621bbbf9 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_GENERATE_HASH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_GENERATE_HASH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_generate_hash \- Generating hash values directly
 .
index 1c8c597b840d7c1f9d357cfa608aee7d02ebfd09..d16daa3675ded652312dae40ec9dbe53456a5f3a 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_GENERATE_HASH_VALUE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_GENERATE_HASH_VALUE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_generate_hash_value \- Generating hash values directly
 .
index 1a8edcecd47f7f10e996729fb3190b7792163bd3..313ac2d765926a8e22b48c9a1fc20b62dad012af 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_GET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_GET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_get \- Retrieving data from the server
 .
index 35e6d16948b3cfd7c2e6fec9d6ad5cfb15d28c54..cf5df925e718ac978092dda019e726efa363ec4a 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_GET_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_GET_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_get_by_key \- Retrieving data from the server
 .
index 2a7e925ee497cfa4bb8c67c51d6dea3c921ec95d..7fae3696fd0dad838240a4907565a191679282ab 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_GET_MEMORY_ALLOCATORS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_GET_MEMORY_ALLOCATORS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_get_memory_allocators \- libmemcached Documentation
 .
index b202233f423c399ddf7b07b03e7fe372fb97365a..b975371cea6e043181d2a39e69cb6ce303cdcb38 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_GET_SASL_CALLBACKS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_GET_SASL_CALLBACKS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_get_sasl_callbacks \- libmemcached Documentation
 .
index a7dff26590a61f8cb90286fd303603b9906d022a..907a6334a538c613a98741478eed4a99026c15dd 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_GET_USER_DATA" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_GET_USER_DATA" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_get_user_data \- libmemcached Documentation
 .
index b71dd5df3f4fe6a53ab10ba64be05e3ec8d8c99a..aeb7f6bfcade6a8cfa36a8997e5e8cf569335b95 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_INCREMENT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_INCREMENT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_increment \- Incrementing and Decrementing Values
 .
index 58b1f8cf60c4d882adcf18daed8a60cac96c8c66..75e3acb5941f53d137d72f046265952090ee3a41 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_INCREMENT_WITH_INITIAL" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_INCREMENT_WITH_INITIAL" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_increment_with_initial \- Incrementing and Decrementing Values
 .
index 9f05e07cc2dd3f6f703256e30dc153800451be29..8e630e618c1f8b6eb10a2635f3c08e78b3e20aa7 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_LAST_ERROR_MESSAGE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_LAST_ERROR_MESSAGE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_last_error_message \- libmemcached Documentation
 .
index 46f4925027f2c14ce64e49bda011dba900e619ce..992925b177521448b5082f98d136fd4c4bf677fa 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_LIB_VERSION" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_LIB_VERSION" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_lib_version \- libmemcached Documentation
 .
index cfb23c1c82b058c0e90eadd70e01c30820a35b2e..b46f39c60c338663ae9df2b6dc4a0c9595b4d184 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_MEMORY_ALLOCATORS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_MEMORY_ALLOCATORS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_memory_allocators \- libmemcached Documentation
 .
index a444bdea89dae25cc119aa99da80ad0118924027..a9af0d14ef833a1127255d479fb3b311bfc0266d 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_MGET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_MGET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_mget \- Retrieving data from the server
 .
index 2371a961abe3145e53b3edd7f0e02a92a5e1c19f..a415f072e0ce4a9b50024f16b5d9fd903bd9c59a 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_MGET_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_MGET_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_mget_by_key \- Retrieving data from the server
 .
index 04797e23bda7b7bd3ecaf6550321dd55083212cf..a73c2ba626a12973397b24112b6a1900c24dab83 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_MGET_EXECUTE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_MGET_EXECUTE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_mget_execute \- Retrieving data from the server
 .
index b77aaf6f7a92d611b5423034d47fb5fddda53534..93e934635253e41a7c562cbe4e9c5464fabd3355 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_MGET_EXECUTE_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_MGET_EXECUTE_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_mget_execute_by_key \- Retrieving data from the server
 .
index 3b0a3afb15925afaaf6d28bcdf13158c0a0fe1d6..144a9ba69cd93e84a41e0d4804d4c980d956daa5 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool \- libmemcached Documentation
 .
index aa0528252b4daa677a94e871073496de2b5f9f4d..197984f1de1ef59015e0dabf3f11dcb47967978d 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_BEHAVIOR_GET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_BEHAVIOR_GET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_behavior_get \- libmemcached Documentation
 .
index 7cb8549671323fc452944c2aa5ca69abe40d1e5d..dc5e5814c25314f951e0158676b4e60df639d0e1 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_BEHAVIOR_SET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_BEHAVIOR_SET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_behavior_set \- libmemcached Documentation
 .
index 1c877546735e5121335efcb49c06ae74b90ca972..dc42e60ce9ad7146e09af2c010b7d211f594c55e 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_CREATE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_CREATE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_create \- libmemcached Documentation
 .
index 4080825c86f6341ef209a9ef8cd50d78b6067eb2..0f5b2583c15a599354924b3ee30dabcc7311009f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_DESTROY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_DESTROY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_destroy \- libmemcached Documentation
 .
index 31079a4dd6a723bd83c67aa0b7229412cfffd07c..dcd461155304637b08b00fa6294304f9aea006bb 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_FETCH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_FETCH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_fetch \- libmemcached Documentation
 .
index 3384c73e7c83c29b044e281103a1b99a51fd94ba..b75a6062b485ae12152db3c3a5cd6cf867208011 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_POP" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_POP" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_pop \- libmemcached Documentation
 .
index 02229b6bb508c2280ccad5082c51848c6851f90f..b8f9dff4631ab8510abfdb9ab51395ca0acbd164 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_PUSH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_PUSH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_push \- libmemcached Documentation
 .
index 6e6d3d2651aba5cc119cfcb5580ee4562cb0a2ad..ec4e35b3df8e212e7c230c53f47f130faa35ba6e 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_RELEASE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_RELEASE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_release \- libmemcached Documentation
 .
index b0f5ea7c8d4cf91d3ca90b5e7f38accd7280ce4e..431d554add4bba4c0b87c42204f66870e7db979b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_POOL_ST" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_POOL_ST" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_pool_st \- libmemcached Documentation
 .
index 864bd1a135415d66718a93bb9bd04f1e69998ab5..6be7cb94f87111baef8fd2abeb380ec9bf178802 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_PREPEND" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_PREPEND" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_prepend \- Appending to or Prepending to data on the server
 .
index 67a8576bb266a43c503c20ad005990201e0c8aea..0b1a785a72c50d46b0618585b42214751c73313b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_PREPEND_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_PREPEND_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_prepend_by_key \- Appending to or Prepending to data on the server
 .
index b39f923ede8be697cfb9f5f3c23c7dc2ad176c97..70c4c3640efaf1e7a7cd214ab64a4153b19826af 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_QUIT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_QUIT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_quit \- libmemcached Documentation
 .
index 63b4a01c8dec72a1ea614418cf3db4fac6ef7bbd..54d18b8180748a6843970041dcead6b16c032bf3 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_REPLACE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_REPLACE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_replace \- Storing and Replacing Data
 .
index 3fb866a33b1e8cd8521033787eec2ef37b2e2cd2..c9f9dea3870db1bbd7ce4595dbd3aeb40f347129 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_REPLACE_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_REPLACE_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_replace_by_key \- Storing and Replacing Data
 .
index 197ac39549e60b0830ec5a1f6433952b675cef48..47899c6d5a428b35f85a66c0c2d12166cac8c2cc 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_CAS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_CAS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_cas \- Working with result sets
 .
index 78f321d504083586f91d8d97caef8290749d6c57..5823a80844f0c1fa730c48a783f2629854755d81 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_CREATE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_CREATE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_create \- Working with result sets
 .
index 55a0b655cf802c3caa73d1b4fcd59ac27fc0f27b..518802522ca73c6416d34e8284b2adf9f89eaa14 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_FLAGS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_FLAGS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_flags \- Working with result sets
 .
index 28852248e6e28a4885a12d05a896978e8b350cc1..7e96d93802e98ebe92f6b7fcaaf5a071fcc127b3 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_FREE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_FREE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_free \- Working with result sets
 .
index b1e098fdec751535ab6a8f9cd85073d239ada465..3d13ca2279a08104685dc5f31554a2efa6f6b138 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_key_length \- Working with result sets
 .
index c178f0c14167b9f6deea47390310e0a095385863..e2e822584cc8bb8ca719a75bc5113319d00d0685 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_KEY_VALUE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_KEY_VALUE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_key_value \- Working with result sets
 .
index 4c710df5bb0df92ff3e3f06a87f5069fb22b2538..5825830b683f1dba1556855874f3f3442343fd1b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_LENGTH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_LENGTH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_length \- Working with result sets
 .
index 8f976bec92b516d3432fdbe647cf925469ec7a55..f850ee2f9d146030abd4952202521fdda0b411ab 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_ST" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_ST" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_st \- Working with result sets
 .
index 3e149b80cc2ab358018b732a62569ddf436c0b29..319a78348ddc276d09ba98f4f04b342201598dd1 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RESULT_VALUE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RESULT_VALUE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_result_value \- Working with result sets
 .
index 2952c43ed31aa8844beaeaf4adb1fd9515714fc2..3eb2a4f3320937e614f618f6464b079b2f5d58ff 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_RETURN_T" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_RETURN_T" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_return_t \- Return type values 
 .
index f12035307c429445f9b05f8fc7c479468b0729d1..11f9fc1145e735f26945e648f40ece952e309017 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SASL" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SASL" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_sasl \- libmemcached Documentation
 .
index 8cb9bf954ede8a2928e02040b48b477034d5c6ec..fa6dfc6c0d76aef498ed230fd4946f2240ea8bae 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SASL_SET_AUTH_DATA" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SASL_SET_AUTH_DATA" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_sasl_set_auth_data \- libmemcached Documentation
 .
index c6f9a5d084482c3e5117467b21f45fb18ed204b5..e808e773373517a05a32a117aceed75fee8b46a8 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_ADD" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_ADD" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_add \- libmemcached Documentation
 .
index 630be74a625cba44a700a7d7d74826d724e74bd3..89b46a6f287afdf5b5ee979223848591f55bf119 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_ADD_UNIX_SOCKET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_ADD_UNIX_SOCKET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_add_unix_socket \- libmemcached Documentation
 .
index 578db462047e6a185ca077fa2b334f44ffc3d50b..cf0a13d08e8af76cefea7451376d9ad7c400bd55 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_COUNT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_COUNT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_count \- libmemcached Documentation
 .
index c004a544628f6ac228b0d379830882346dcce134..d97365d47053ee8416084cdaf734014415c512f0 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_CURSOR" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_CURSOR" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_cursor \- libmemcached Documentation
 .
index f0f2c326e4df75802ee1140249e7154f2768ed11..0f73953b6cad6f6f7c0876468f0ef0650a50af2e 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_LIST" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_list \- libmemcached Documentation
 .
index 777a6e7956a115ed1b343cf849d00dc579e1ab74..79a3127ac26e431339b1e0bb9b7624d12344266c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_LIST_APPEND" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_APPEND" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_list_append \- libmemcached Documentation
 .
index 981bd3e41d07fc7f7d0afa3f70b7c24e42dc5b8c..8cbf88aa4af876fa96803c2c810ec7dcf167522e 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_LIST_COUNT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_COUNT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_list_count \- libmemcached Documentation
 .
index d0a4a667f2b6ac7b22d81488088f5e3345063691..e449124045eec11535344bd47a580b5283a6f525 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_LIST_FREE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_FREE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_list_free \- libmemcached Documentation
 .
index 2d41c231e28a063d6794f710ba22f055529d6f4a..02b535efc76165146def465bbc7a9277c7eb4aec 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_PUSH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_PUSH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_push \- libmemcached Documentation
 .
index 83e288ea898d7da95d1fb9a4b40cc860a762b7bd..2880563e7e369e1a30b7f5b79cffcbf9a375185e 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVER_ST" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVER_ST" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_server_st \- libmemcached Documentation
 .
index 658529260817a21fbf59e427ba16e0b0a8299f2e..a242953abeff22980cbf0cbc8221908f97978d23 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVERS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVERS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_servers \- libmemcached Documentation
 .
index c769f5c3a8151461695713f9d1b59bc24015c013..abb2fcf1547b54f94b1488e1ff62d9f2dc78509c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVERS_PARSE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVERS_PARSE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_servers_parse \- libmemcached Documentation
 .
index fdf89337d8a2c21712585a5f9e62ee63c683e5b5..de28f1f18c77531b16435a1bd3c6ab6da7ded1a4 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SERVERS_RESET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SERVERS_RESET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_servers_reset \- libmemcached Documentation
 .
index ed512111bd475206182e98a56522411d6d94981a..aa3eddc6a7980a7d4ea51335d27daf8cee5c9323 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SET" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SET" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_set \- Storing and Replacing Data
 .
index f059a21d48a4ef6f94032af9958900f01e0f10a9..f1a0ec15ae33c0ad6193921399fb01ebf92f0156 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SET_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SET_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_set_by_key \- Storing and Replacing Data
 .
index 4d199c7d7faeae2262e68409a3f30cd013f53385..0d94edd79c00862019a96a8591d4e7c29c8d54f7 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SET_ENCODING_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SET_ENCODING_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_set_encoding_key \- libmemcached Documentation
 .
index e625312c305fd7e78ac6a47afed75a651cc46900..33db32af65e15f8001dc973b3db46e6f0aa2ea3b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_set_memory_allocators \- libmemcached Documentation
 .
index 2825146ee9021344e78cc9f624027b5597dc629f..81168cfc25de0d9fd2c1e0760f607a93eb68cc05 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SET_MEMORY_ALLOCATORS_CONTEXT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SET_MEMORY_ALLOCATORS_CONTEXT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_set_memory_allocators_context \- libmemcached Documentation
 .
index d211ad9817a1b560363f9608e90c131cbc4abfc8..c405564183e5a584516f8e56b98b71e9213f73f7 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SET_SASL_CALLBACKS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SET_SASL_CALLBACKS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_set_sasl_callbacks \- libmemcached Documentation
 .
index 62229aea8433a0ab87bc21bcf8237ecd9a1fe4aa..bcb4d033e42099df09569518286d232b650ed24a 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_SET_USER_DATA" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_SET_USER_DATA" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_set_user_data \- libmemcached Documentation
 .
index e8e0cb2b9a298eb1f6c73eb57dd9686731630db7..cf34d0d7da8bafa74dc37b0a995d7b51037a4898 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_STAT" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_STAT" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_stat \- libmemcached Documentation
 .
index 47ae085329969255246a36bbb6dfbbe422539864..ca6bcfb41b686ae7eb0378b8bb207f6db0804798 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_STAT_EXECUTE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_STAT_EXECUTE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_stat_execute \- libmemcached Documentation
 .
index 9d5d4e644495a1d0befd4913dd27f2d2781efaac..ecf429c04c7dd60a17bcfaac072e8233b93f6caf 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_STAT_GET_KEYS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_STAT_GET_KEYS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_stat_get_keys \- libmemcached Documentation
 .
index 8059f23b61debb2cfb5c2a9bf9dcae755a55410d..2ddb34d9a5a61c3de04ed6c179df06c1840dd176 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_STAT_GET_VALUE" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_STAT_GET_VALUE" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_stat_get_value \- libmemcached Documentation
 .
index dcd3a83adb04a2b9c06ba23b896f810905d845e0..d9818677d8cf3e3fef0f384f56134de1abcf4b5c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_STAT_SERVERNAME" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_STAT_SERVERNAME" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_stat_servername \- libmemcached Documentation
 .
index 3e2be69e42a1305f94e3872142380d02813b3244..5853855e22cf2710631c5625f14e4ffdb57b54c7 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_STATS" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_STATS" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_stats \- libmemcached Documentation
 .
index 2cf55113a714c912061a1d58366f55a3a4172ed8..20d81eaa38a1600c6a45337c052f0ec3312c643c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_STRERROR" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_STRERROR" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_strerror \- libmemcached Documentation
 .
index 1f1a4ebf6ec88d3099df101e0263fcc064644a3f..2fb764646010ee2009cd79e3d457c1097a39fa33 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_TOUCH" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_TOUCH" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_touch \- libmemcached Documentation
 .
index d5da5bc9bfe64fb5aaeb07dc51f02a02de828cae..37c0da9b2f8077e821a6944a74ea716e49a64d9f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_TOUCH_BY_KEY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_TOUCH_BY_KEY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_touch_by_key \- libmemcached Documentation
 .
index 7eb630affd247c405f830a1565d3e768f365c112..46bd3830554c488771f7707881da23db2a5922e8 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_USER_DATA" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_USER_DATA" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_user_data \- libmemcached Documentation
 .
index 574ad75e1e00f99e1e246d5f4fa5ff4d35df210e..55308b3c0a274788bef9dd36343ba5e24c9efced 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_VERBOSITY" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_VERBOSITY" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_verbosity \- libmemcached Documentation
 .
index ff89b197be81c84cdc369fb2c68ddbb94b5e9f9a..330bf93077be4dedb6397ff7bbeeefc84570b18f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCACHED_VERSION" "3" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCACHED_VERSION" "3" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcached_version \- libmemcached Documentation
 .
index ba39649bc12ffcba8220388478a66b8da2e4d2e5..d9e6f296f9915fad558904028e2bd7d7a5ce2326 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCAPABLE" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCAPABLE" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcapable \- libmemcached Documentation
 .
index b3418059bfea3c415d468f0a3a98ad44f454ef3a..72a829b835e1305464a7ddb65ddcad906adf85e4 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCAT" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCAT" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcat \- libmemcached Documentation
 .
index 93c4ff020a05e1f67f98c6b4f4f8259c6bcb9304..7e04129fe9c52700a8042f922303759fd95ae1de 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMCP" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMCP" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memcp \- libmemcached Documentation
 .
index 9d26a0e967c7cfe262fa193f85900c48fc8160a0..39c87fe498a821e7c92a6d49e698de82bfea582c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMDUMP" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMDUMP" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memdump \- libmemcached Documentation
 .
index bb9f5cec15fdd0c24133a091b6e84137e87a86df..7bcdd7e81a47df6c96ebfe97fbfc696dc8d655b0 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMERROR" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMERROR" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memerror \- libmemcached Documentation
 .
index 1ae6ff43865640d94e017c717284674d75f8a770..8ff5077f8345c19a2ae3533a70fb579f658f736b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMEXIST" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMEXIST" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memexist \- libmemcached Documentation
 .
index 1681031e58c1dcc230f9a3ceaff77e7a675236ea..1235cb47563b34c8f24b8193fe3da3410c7012ce 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMFLUSH" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMFLUSH" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memflush \- libmemcached Documentation
 .
index 314a0c5fb4cc228af7d679a6e2b749757f5ae24c..9443de3940d3a20c9f1196e07a714d6a6fef1270 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMPARSE" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMPARSE" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memparse \- libmemcached Documentation
 .
index 6a266f526538b4cc6155fef2df7f9dc3bb299b03..840f2c9c677f1c6d725a95ea1c1e638869ad168b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMPING" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMPING" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memping \- libmemcached Documentation
 .
index cf51f6a6e6210a2fb83c871bf3281f795ea0aba9..23551d465234ba33b1eac7ded410843c0cd09bdc 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMRM" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMRM" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memrm \- libmemcached Documentation
 .
index 812a25cb31a1c3671da6ca26c4c3cc236ff3421a..e75574410a15c7742d0ae871795ae89365738075 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMSLAP" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMSLAP" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memslap \- libmemcached Documentation
 .
index cc6721a6f0f135cf6c9887d8261a0e23fc09d1fd..c46e82a6ff93adba4ecbd820b08f55342d112fd3 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMSTAT" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMSTAT" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memstat \- libmemcached Documentation
 .
index 7356331a877f32086c93cdea7e7a2cc0b930829c..0372ea2fb2eba6f43f3eccc029a01ef62c9c90f2 100644 (file)
@@ -1,4 +1,4 @@
-.TH "MEMTOUCH" "1" "July 31, 2012" "1.0.10" "libmemcached"
+.TH "MEMTOUCH" "1" "August 02, 2012" "1.0.10" "libmemcached"
 .SH NAME
 memtouch \- libmemcached Documentation
 .
index 9158b1425de8dd34c95d164e66015c7eaa58ed3b..e76841a17360d3b809578634158bb836510b95b0 100644 (file)
@@ -238,7 +238,7 @@ static bool world_destroy(void *object)
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->create(world_create);
   world->destroy(world_destroy);
index 63b07a00e80a8b3b6219524515e6ef756a51ac94..624887b74daee55bbedc839ac81b3540d176dc4e 100644 (file)
@@ -45,7 +45,7 @@ struct memcached_st {
     bool is_purging:1;
     bool is_processing_input:1;
     bool is_time_for_rebuild:1;
-    bool not_used:1;
+    bool is_parsing:1;
   } state;
 
   struct {
index 5a5d899d23786d8f9ccebe5fb113e21887e8461a..8d027df27fc229b44659d59ef4144954335dd1f9 100644 (file)
@@ -250,29 +250,31 @@ static void set_socket_options(org::libmemcached::Instance* server)
   }
 
 #ifdef HAVE_SNDTIMEO
-  if (server->root->snd_timeout)
+  if (server->root->snd_timeout > 0)
   {
     struct timeval waittime;
 
-    waittime.tv_sec= 0;
-    waittime.tv_usec= server->root->snd_timeout;
+    waittime.tv_sec= server->root->snd_timeout / 1000000;
+    waittime.tv_usec= server->root->snd_timeout % 1000000;
 
     int error= setsockopt(server->fd, SOL_SOCKET, SO_SNDTIMEO,
-                      &waittime, (socklen_t)sizeof(struct timeval));
+                          &waittime, (socklen_t)sizeof(struct timeval));
+    (void)error;
     assert(error == 0);
   }
 #endif
 
 #ifdef HAVE_RCVTIMEO
-  if (server->root->rcv_timeout)
+  if (server->root->rcv_timeout > 0)
   {
     struct timeval waittime;
 
-    waittime.tv_sec= 0;
-    waittime.tv_usec= server->root->rcv_timeout;
+    waittime.tv_sec= server->root->rcv_timeout / 1000000;
+    waittime.tv_usec= server->root->rcv_timeout % 1000000;
 
     int error= setsockopt(server->fd, SOL_SOCKET, SO_RCVTIMEO,
                           &waittime, (socklen_t)sizeof(struct timeval));
+    (void)(error);
     assert(error == 0);
   }
 #endif
@@ -283,11 +285,14 @@ static void set_socket_options(org::libmemcached::Instance* server)
     int set= 1;
     int error= setsockopt(server->fd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int));
 
+    assert(error == 0);
+
     // This is not considered a fatal error
     if (error == -1)
     {
-      WATCHPOINT_ERRNO(get_socket_errno());
+#if 0
       perror("setsockopt(SO_NOSIGPIPE)");
+#endif
     }
   }
 #endif
@@ -300,6 +305,7 @@ static void set_socket_options(org::libmemcached::Instance* server)
     linger.l_linger= 0; /* By default on close() just drop the socket */
     int error= setsockopt(server->fd, SOL_SOCKET, SO_LINGER,
                           &linger, (socklen_t)sizeof(struct linger));
+    (void)(error);
     assert(error == 0);
   }
 
@@ -309,6 +315,7 @@ static void set_socket_options(org::libmemcached::Instance* server)
 
     int error= setsockopt(server->fd, IPPROTO_TCP, TCP_NODELAY,
                           &flag, (socklen_t)sizeof(int));
+    (void)(error);
     assert(error == 0);
   }
 
@@ -318,6 +325,7 @@ static void set_socket_options(org::libmemcached::Instance* server)
 
     int error= setsockopt(server->fd, SOL_SOCKET, SO_KEEPALIVE,
                       &flag, (socklen_t)sizeof(int));
+    (void)(error);
     assert(error == 0);
   }
 
@@ -326,6 +334,7 @@ static void set_socket_options(org::libmemcached::Instance* server)
   {
     int error= setsockopt(server->fd, IPPROTO_TCP, TCP_KEEPIDLE,
                           &server->root->tcp_keepidle, (socklen_t)sizeof(int));
+    (void)(error);
     assert(error == 0);
   }
 #endif
@@ -334,6 +343,7 @@ static void set_socket_options(org::libmemcached::Instance* server)
   {
     int error= setsockopt(server->fd, SOL_SOCKET, SO_SNDBUF,
                           &server->root->send_size, (socklen_t)sizeof(int));
+    (void)(error);
     assert(error == 0);
   }
 
@@ -341,6 +351,7 @@ static void set_socket_options(org::libmemcached::Instance* server)
   {
     int error= setsockopt(server->fd, SOL_SOCKET, SO_RCVBUF,
                           &server->root->recv_size, (socklen_t)sizeof(int));
+    (void)(error);
     assert(error == 0);
   }
 
@@ -729,6 +740,11 @@ static memcached_return_t _memcached_connect(org::libmemcached::Instance* server
 
 memcached_return_t memcached_connect_try(org::libmemcached::Instance* server)
 {
+  if (server and server->root and server->root->state.is_parsing)
+  {
+    return MEMCACHED_SUCCESS;
+  }
+
   return _memcached_connect(server, false);
 }
 
index 77fac219bdd79ed2ecca1fd634af9e76c5ca5935..12e028ddcaeac95c74c33073e273d3957a1cff50 100644 (file)
@@ -61,6 +61,8 @@ public:
     memc= memc_arg;
     init_scanner();
     rc= MEMCACHED_SUCCESS;
+
+    memc->state.is_parsing= true;
   }
 
   bool end()
@@ -106,6 +108,7 @@ public:
   ~Context()
   {
     destroy_scanner();
+    memc->state.is_parsing= false;
   }
 
   yytokentype previous_token;
index c52873ad3d4fcbccecb86ded6961a9844dc48dcf..765b79ab7fd650e16d72a363f841fe06d8f3e55a 100644 (file)
@@ -45,6 +45,7 @@ static inline bool _memcached_init(memcached_st *self)
   self->state.is_purging= false;
   self->state.is_processing_input= false;
   self->state.is_time_for_rebuild= false;
+  self->state.is_parsing= false;
 
   self->flags.auto_eject_hosts= false;
   self->flags.binary_protocol= false;
index 94d4cce48d4bd65a0bcb01583d8944b01ec377d7..5cb76bff04bb9b4d895f43a86e33d1e53f2d77fa 100644 (file)
@@ -53,6 +53,8 @@ using namespace libtest;
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <algorithm>
+
 #ifndef __USE_GNU
 static char **environ= NULL;
 #endif
@@ -80,18 +82,21 @@ extern "C" {
 
 namespace {
 
-  std::string print_argv(char * * & built_argv, const size_t& argc)
+  std::string print_argv(libtest::vchar_ptr_t& built_argv)
   {
     std::stringstream arg_buffer;
 
-    for (size_t x= 0; x < argc; ++x)
+    for (vchar_ptr_t::iterator iter= built_argv.begin();
+         iter == built_argv.end();
+         iter++)
     {
-      arg_buffer << built_argv[x] << " ";
+      arg_buffer << *iter << " ";
     }
 
     return arg_buffer.str();
   }
 
+#if 0
   std::string print_argv(char** argv)
   {
     std::stringstream arg_buffer;
@@ -103,6 +108,7 @@ namespace {
 
     return arg_buffer.str();
   }
+#endif
 
   static Application::error_t int_to_error_t(int arg)
   {
@@ -134,7 +140,6 @@ Application::Application(const std::string& arg, const bool _use_libtool_arg) :
   stdin_fd(STDIN_FILENO),
   stdout_fd(STDOUT_FILENO),
   stderr_fd(STDERR_FILENO),
-  built_argv(NULL),
   _pid(-1)
   { 
     if (_use_libtool)
@@ -249,13 +254,14 @@ Application::error_t Application::run(const char *args[])
   }
   else
   {
+
     if (_use_libtool)
     {
-      spawn_ret= posix_spawn(&_pid, built_argv[0], &file_actions, &spawnattr, built_argv, NULL);
+      spawn_ret= posix_spawn(&_pid, built_argv[0], &file_actions, &spawnattr, &built_argv[0], NULL);
     }
     else
     {
-      spawn_ret= posix_spawnp(&_pid, built_argv[0], &file_actions, &spawnattr, built_argv, NULL);
+      spawn_ret= posix_spawnp(&_pid, built_argv[0], &file_actions, &spawnattr, &built_argv[0], NULL);
     }
   }
 
@@ -458,6 +464,66 @@ Application::error_t Application::wait(bool nohang)
   return exit_code;
 }
 
+Application::error_t Application::join()
+{
+  if (_pid == -1)
+  {
+    return Application::INVALID;
+  }
+
+  slurp();
+
+  error_t exit_code= FAILURE;
+  {
+    int status= 0;
+    pid_t waited_pid;
+    do {
+      waited_pid= waitpid(_pid, &status, 0);
+    } while (waited_pid == -1 and (errno == EINTR or errno == EAGAIN));
+
+    if (waited_pid == -1)
+    {
+      switch (errno)
+      {
+      case ECHILD:
+        exit_code= Application::SUCCESS;
+        break;
+
+      case EINTR:
+        break;
+
+      default:
+        Error << "Error occured while waitpid(" << strerror(errno) << ") on pid " << int(_pid);
+        break;
+      }
+    }
+    else if (waited_pid == 0)
+    {
+      exit_code= Application::SUCCESS;
+    }
+    else
+    {
+      if (waited_pid != _pid)
+      {
+        throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "Pid mismatch, %d != %d", int(waited_pid), int(_pid));
+      }
+
+      exit_code= int_to_error_t(exited_successfully(status));
+    }
+  }
+
+  slurp();
+
+#if 0
+  if (exit_code == Application::INVALID)
+  {
+    Error << print_argv(built_argv, _argc);
+  }
+#endif
+
+  return exit_code;
+}
+
 void Application::add_long_option(const std::string& name, const std::string& option_value)
 {
   std::string arg(name);
@@ -526,7 +592,7 @@ bool Application::Pipe::read(libtest::vchar_t& arg)
 
     data_was_read= true;
     arg.reserve(read_length +1);
-    for (size_t x= 0; x < read_length; ++x)
+    for (size_t x= 0; x < size_t(read_length); ++x)
     {
       arg.push_back(buffer[x]);
     }
@@ -640,61 +706,11 @@ void Application::Pipe::close(const close_t& arg)
 void Application::create_argv(const char *args[])
 {
   delete_argv();
-  fatal_assert(_argc == 0);
-
-  if (_use_libtool)
-  {
-    _argc+= 2; // +2 for libtool --mode=execute
-  }
-
-  _argc+= 1; // For the command
-
-  /*
-    valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --track-origin=yes --malloc-fill=A5 --free-fill=DE --log-file=
-  */
-  if (_use_valgrind)
-  {
-    _argc+= 8;
-  }
-  else if (_use_ptrcheck)
-  {
-    /*
-      valgrind --error-exitcode=1 --tool=exp-ptrcheck --log-file= 
-    */
-    _argc+= 4;
-  }
-  else if (_use_gdb) // gdb
-  {
-    _argc+= 1;
-  }
-
-  for (Options::const_iterator iter= _options.begin(); iter != _options.end(); ++iter)
-  {
-    _argc++;
-    if ((*iter).second.empty() == false)
-    {
-      _argc++;
-    }
-  }
-
-  if (args)
-  {
-    for (const char **ptr= args; *ptr; ++ptr)
-    {
-      _argc++;
-    }
-  }
-
-  _argc+= 1; // for the NULL
-
-  built_argv= new char * [_argc];
-
-  size_t x= 0;
   if (_use_libtool)
   {
     assert(libtool());
-    built_argv[x++]= strdup(libtool());
-    built_argv[x++]= strdup("--mode=execute");
+    built_argv.push_back(strdup(libtool()));
+    built_argv.push_back(strdup("--mode=execute"));
   }
 
   if (_use_valgrind)
@@ -702,51 +718,50 @@ void Application::create_argv(const char *args[])
     /*
       valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE
     */
-    built_argv[x++]= strdup("valgrind");
-    built_argv[x++]= strdup("--error-exitcode=1");
-    built_argv[x++]= strdup("--leak-check=yes");
-    built_argv[x++]= strdup("--show-reachable=yes");
-    built_argv[x++]= strdup("--track-fds=yes");
+    built_argv.push_back(strdup("valgrind"));
+    built_argv.push_back(strdup("--error-exitcode=1"));
+    built_argv.push_back(strdup("--leak-check=yes"));
+    built_argv.push_back(strdup("--show-reachable=yes"));
+    built_argv.push_back(strdup("--track-fds=yes"));
 #if 0
     built_argv[x++]= strdup("--track-origin=yes");
 #endif
-    built_argv[x++]= strdup("--malloc-fill=A5");
-    built_argv[x++]= strdup("--free-fill=DE");
+    built_argv.push_back(strdup("--malloc-fill=A5"));
+    built_argv.push_back(strdup("--free-fill=DE"));
 
     std::string log_file= create_tmpfile("valgrind");
     char buffer[1024];
     int length= snprintf(buffer, sizeof(buffer), "--log-file=%s", log_file.c_str());
-    fatal_assert(length > 0 and length < sizeof(buffer));
-    built_argv[x++]= strdup(buffer);
+    fatal_assert(length > 0 and size_t(length) < sizeof(buffer));
+    built_argv.push_back(strdup(buffer));
   }
   else if (_use_ptrcheck)
   {
     /*
       valgrind --error-exitcode=1 --tool=exp-ptrcheck --log-file= 
     */
-    built_argv[x++]= strdup("valgrind");
-    built_argv[x++]= strdup("--error-exitcode=1");
-    built_argv[x++]= strdup("--tool=exp-ptrcheck");
-    _argc+= 4;
+    built_argv.push_back(strdup("valgrind"));
+    built_argv.push_back(strdup("--error-exitcode=1"));
+    built_argv.push_back(strdup("--tool=exp-ptrcheck"));
     std::string log_file= create_tmpfile("ptrcheck");
     char buffer[1024];
     int length= snprintf(buffer, sizeof(buffer), "--log-file=%s", log_file.c_str());
-    fatal_assert(length > 0 and length < sizeof(buffer));
-    built_argv[x++]= strdup(buffer);
+    fatal_assert(length > 0 and size_t(length) < sizeof(buffer));
+    built_argv.push_back(strdup(buffer));
   }
   else if (_use_gdb)
   {
-    built_argv[x++]= strdup("gdb");
+    built_argv.push_back(strdup("gdb"));
   }
 
-  built_argv[x++]= strdup(_exectuble_with_path.c_str());
+  built_argv.push_back(strdup(_exectuble_with_path.c_str()));
 
   for (Options::const_iterator iter= _options.begin(); iter != _options.end(); ++iter)
   {
-    built_argv[x++]= strdup((*iter).first.c_str());
+    built_argv.push_back(strdup((*iter).first.c_str()));
     if ((*iter).second.empty() == false)
     {
-      built_argv[x++]= strdup((*iter).second.c_str());
+      built_argv.push_back(strdup((*iter).second.c_str()));
     }
   }
 
@@ -754,16 +769,15 @@ void Application::create_argv(const char *args[])
   {
     for (const char **ptr= args; *ptr; ++ptr)
     {
-      built_argv[x++]= strdup(*ptr);
+      built_argv.push_back(strdup(*ptr));
     }
   }
-  built_argv[x++]= NULL;
-  fatal_assert(x == _argc);
+  built_argv.push_back(NULL);
 }
 
 std::string Application::print()
 {
-  return print_argv(built_argv, _argc);
+  return print_argv(built_argv);
 }
 
 std::string Application::arguments()
@@ -780,21 +794,21 @@ std::string Application::arguments()
   return arg_buffer.str();
 }
 
-void Application::delete_argv()
+struct DeleteFromVector
 {
-  if (built_argv)
-  {
-    for (size_t x= 0; x < _argc; ++x)
+  template <class T>
+    void operator() ( T* ptr) const
     {
-      if (built_argv[x])
-      {
-        ::free(built_argv[x]);
-      }
+      free(ptr);
     }
-    delete[] built_argv;
-    built_argv= NULL;
-    _argc= 0;
-  }
+};
+
+void Application::delete_argv()
+{
+  std::for_each(built_argv.begin(), built_argv.end(), DeleteFromVector());
+
+  built_argv.clear();
+  _argc= 0;
 }
 
 
@@ -809,7 +823,7 @@ int exec_cmdline(const std::string& command, const char *args[], bool use_libtoo
     return int(ret);
   }
 
-  return int(app.wait(false));
+  return int(app.join());
 }
 
 const char *gearmand_binary() 
index 9dd9f813e82bdf307ce1b0567ce1f532b265ad32..46f7ad78a886f2997ad3e588920b9da9dd3f832b 100644 (file)
@@ -56,6 +56,26 @@ public:
     INVALID= 127
   };
 
+  static const char* toString(error_t arg)
+  {
+    switch (arg)
+    {
+    case Application::SUCCESS:
+      return "EXIT_SUCCESS";
+
+    case Application::FAILURE:
+      return "EXIT_FAILURE";
+
+    case Application::INVALID:
+      return "127";
+
+    default:
+      break;
+    }
+
+    return "EXIT_UNKNOWN";
+  }
+
   class Pipe {
   public:
     Pipe(int);
@@ -92,6 +112,7 @@ public:
   void add_long_option(const std::string& option_name, const std::string& option_value);
   error_t run(const char *args[]= NULL);
   error_t wait(bool nohang= true);
+  Application::error_t join();
 
   libtest::vchar_t stdout_result() const
   {
@@ -176,7 +197,7 @@ private:
   Pipe stdin_fd;
   Pipe stdout_fd;
   Pipe stderr_fd;
-  char * * built_argv;
+  libtest::vchar_ptr_t built_argv;
   pid_t _pid;
   libtest::vchar_t _stdout_buffer;
   libtest::vchar_t _stderr_buffer;
@@ -184,25 +205,7 @@ private:
 
 static inline std::ostream& operator<<(std::ostream& output, const enum Application::error_t &arg)
 {
-  switch (arg)
-  {
-    case Application::SUCCESS:
-      output << "EXIT_SUCCESS";
-      break;
-
-    case Application::FAILURE:
-      output << "EXIT_FAILURE";
-      break;
-
-    case Application::INVALID:
-      output << "127";
-      break;
-
-    default:
-      output << "EXIT_UNKNOWN";
-  }
-
-  return output;
+  return output << Application::toString(arg);
 }
 
 int exec_cmdline(const std::string& executable, const char *args[], bool use_libtool= false);
index 3f85d0fe9ea0394e2d1bd9ba1b86bfeec17b2311..26e8bb44e33d455ef725546dc98fe338da3427b3 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <libtest/common.h>
 
-static test_return_t runner_code(Framework* frame,
+static test_return_t runner_code(libtest::Framework* frame,
                                  test_st* run, 
                                  libtest::Timer& _timer)
 { // Runner Code
@@ -84,21 +84,22 @@ Collection::Collection(Framework* frame_arg,
   _success(0),
   _skipped(0),
   _failed(0),
-  _total(0)
+  _total(0),
+  _formatter(_name)
 {
   fatal_assert(arg);
 }
 
 test_return_t Collection::exec()
 {
-  Out << "Collection: " << _name;
-
   if (test_success(_frame->runner()->pre(_pre, _frame->creators_ptr())))
   {
     for (test_st *run= _tests; run->name; run++)
     {
+      formatter()->push_testcase(run->name);
       if (_frame->match(run->name))
       {
+        formatter()->skipped();
         continue;
       }
       _total++;
@@ -112,38 +113,46 @@ test_return_t Collection::exec()
           {
             Error << "frame->runner()->flush(creators_ptr)";
             _skipped++;
+            formatter()->skipped();
             continue;
           }
         }
 
-        return_code= runner_code(_frame, run, _timer);
+        alarm(600);
+        try 
+        {
+          return_code= runner_code(_frame, run, _timer);
+        }
+        catch (...)
+        {
+          alarm(0);
+          throw;
+        }
+        alarm(0);
       }
-      catch (libtest::fatal &e)
+      catch (libtest::exception &e)
       {
         stream::cerr(e.file(), e.line(), e.func()) << e.what();
         _failed++;
+        formatter()->failed();
         throw;
       }
 
       switch (return_code)
       {
       case TEST_SUCCESS:
-        Out << "\tTesting " 
-          << run->name
-          <<  "\t\t\t\t\t" 
-          << _timer 
-          << " [ " << test_strerror(return_code) << " ]";
         _success++;
+        formatter()->success(_timer);
         break;
 
       case TEST_FAILURE:
         _failed++;
-        Out << "\tTesting " << run->name <<  "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
+        formatter()->failed();
         break;
 
       case TEST_SKIPPED:
         _skipped++;
-        Out << "\tTesting " << run->name <<  "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
+        formatter()->skipped();
         break;
 
       default:
index 91c76a6d7f9084558a892f2c3779855af2c51471..bc879e3091d79f94592613b6c049c6c5f859b2f6 100644 (file)
 
 #pragma once
 
+#include <libtest/formatter.hpp>
+
 #include <libtest/timer.hpp>
 
-class Framework;
+namespace { class Framework; }
+
 
 /**
   A structure which describes a collection of test cases.
@@ -54,13 +57,13 @@ namespace libtest {
 
 class Collection {
 public:
-  Collection(Framework*, collection_st*);
+  Collection(libtest::Framework*, collection_st*);
 
   test_return_t exec();
 
   const char* name()
   {
-    return _name;
+    return _name.c_str();
   }
 
   uint32_t success()
@@ -83,17 +86,23 @@ public:
     return _total;
   }
 
+  libtest::Formatter* formatter()
+  {
+    return &_formatter;
+  }
+
 private:
-  const char *_name;
+  std::string _name;
   test_callback_fn *_pre;
   test_callback_fn *_post;
   struct test_st *_tests;
-  Framework* _frame;
+  libtest::Framework* _frame;
   uint32_t _success;
   uint32_t _skipped;
   uint32_t _failed;
   uint32_t _total;
   libtest::Timer _timer;
+  libtest::Formatter _formatter;
 };
 
 } // namespace libtest
index 498baf341a5e4235a746fc78268a20394a063507..4d8d5724ce5c7e4aa5ea1134fa49362e201fc28b 100644 (file)
@@ -78,4 +78,5 @@
 #include <libtest/killpid.h>
 #include <libtest/signal.h>
 #include <libtest/dns.hpp>
+#include <libtest/formatter.hpp>
 
index 70eca0268591f8efbe511044e7d687fdbee4c64c..49fe29699f2843984988d8c8ec56515f8afd41f6 100644 (file)
@@ -70,6 +70,7 @@ using namespace libtest;
 namespace libtest {
 bool ping_drizzled(const in_port_t _port)
 {
+  (void)(_port);
 #if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
   {
     drizzle_st *drizzle= drizzle_create(NULL);
@@ -148,7 +149,7 @@ public:
     return "drizzled";
   };
 
-  void log_file_option(Application& app, const std::string& arg)
+  void log_file_option(Application&, const std::string&)
   {
   }
 
index c61b5cfb8fe0ea842b5f99e0f7f5781c20dfcc50..9517f778d23ab7587876eaf897b2d4183ccd599e 100644 (file)
 
 namespace libtest {
 
-fatal::fatal(const char *file_arg, int line_arg, const char *func_arg, const char *format, ...) :
-  std::runtime_error(func_arg),
-  _line(line_arg),
-  _file(file_arg),
-  _func(func_arg)
+exception::exception(const char *file_, int line_, const char *func_) :
+  std::runtime_error(func_),
+  _file(file_),
+  _line(line_),
+  _func(func_)
+  {
+  }
+
+fatal::fatal(const char *file_, int line_, const char *func_, const char *format, ...) :
+  exception(file_, line_, func_)
   {
     va_list args;
     va_start(args, format);
@@ -52,8 +57,6 @@ fatal::fatal(const char *file_arg, int line_arg, const char *func_arg, const cha
     int last_error_length= vsnprintf(last_error, sizeof(last_error), format, args);
     va_end(args);
 
-    strncpy(_mesg, last_error, sizeof(_mesg));
-
     snprintf(_error_message, sizeof(_error_message), "%.*s", last_error_length, last_error);
   }
 
@@ -85,23 +88,34 @@ void fatal::increment_disabled_counter()
   _counter++;
 }
 
-disconnected::disconnected(const char *file_arg, int line_arg, const char *func_arg,
-                           const char *instance, const in_port_t port,
+disconnected::disconnected(const char *file_, int line_, const char *func_,
+                           const std::string& instance, const in_port_t port,
                            const char *format, ...) :
-  std::runtime_error(func_arg),
-  _port(port),
-  _line(line_arg),
-  _file(file_arg),
-  _func(func_arg)
+  exception(file_, line_, func_),
+  _port(port)
+{
+  va_list args;
+  va_start(args, format);
+  char last_error[BUFSIZ];
+  (void)vsnprintf(last_error, sizeof(last_error), format, args);
+  va_end(args);
+
+  snprintf(_error_message, sizeof(_error_message), "%s:%u %s", instance.c_str(), uint32_t(port), last_error);
+}
+
+start::start(const char *file_, int line_, const char *func_,
+             const std::string& instance, const in_port_t port,
+             const char *format, ...) :
+  exception(file_, line_, func_),
+  _port(port)
 {
-  strncpy(_instance, instance, sizeof(_instance));
   va_list args;
   va_start(args, format);
   char last_error[BUFSIZ];
   (void)vsnprintf(last_error, sizeof(last_error), format, args);
   va_end(args);
 
-  snprintf(_error_message, sizeof(_error_message), "%s", last_error);
+  snprintf(_error_message, sizeof(_error_message), "%s:%u %s", instance.c_str(), uint32_t(port), last_error);
 }
 
 } // namespace libtest
index 7a8ce5161491173670359ed67ca08dad9a807478..6ac62b775f84b224ce0673cea507b2e8a3f43f3f 100644 (file)
 
 namespace libtest {
 
-class fatal : std::runtime_error
+class exception : public std::runtime_error
 {
 public:
-  fatal(const char *file, int line, const char *func, const char *format, ...);
+  exception(const char *, int, const char *);
 
-  const char* what() const throw()
+  int line() const
   {
-    return _error_message;
+    return _line;
   }
 
-  const char* mesg() const throw()
+  const char*  file() const
   {
-    return _error_message;
+    return _file;
   }
 
-  // The following are just for unittesting the exception class
-  static bool is_disabled();
-  static void disable();
-  static void enable();
-  static uint32_t disabled_counter();
-  static void increment_disabled_counter();
-
-  int line()
+  const char* func() const
   {
-    return _line;
+    return _func;
   }
 
-  const char*  file()
+  const char* mesg() const throw()
   {
-    return _file;
+    return _error_message;
   }
 
-  const char* func()
-  {
-    return _func;
-  }
 
-private:
+protected:
   char _error_message[BUFSIZ];
-  char _mesg[BUFSIZ];
-  int _line;
+
+private:
   const char*  _file;
+  int _line;
   const char* _func;
 };
 
-class disconnected : std::runtime_error
+class fatal : public exception
 {
 public:
-  disconnected(const char *file, int line, const char *func, const char *instance, const in_port_t port, const char *format, ...);
+  fatal(const char *file, int line, const char *func, const char *format, ...);
 
   const char* what() const throw()
   {
@@ -115,28 +105,51 @@ public:
   static uint32_t disabled_counter();
   static void increment_disabled_counter();
 
-  int line()
-  {
-    return _line;
-  }
+private:
+};
+
+class disconnected : public exception
+{
+public:
+  disconnected(const char *file, int line, const char *func, const std::string&, const in_port_t port, const char *format, ...);
 
-  const char* file()
+  const char* what() const throw()
   {
-    return _file;
+    return _error_message;
   }
 
-  const char* func()
+  // The following are just for unittesting the exception class
+  static bool is_disabled();
+  static void disable();
+  static void enable();
+  static uint32_t disabled_counter();
+  static void increment_disabled_counter();
+
+private:
+  in_port_t _port;
+  char _instance[1024];
+};
+
+class start : public exception
+{
+public:
+  start(const char *file, int line, const char *func, const std::string&, const in_port_t port, const char *format, ...);
+
+  const char* what() const throw()
   {
-    return _func;
+    return _error_message;
   }
 
+  // The following are just for unittesting the exception class
+  static bool is_disabled();
+  static void disable();
+  static void enable();
+  static uint32_t disabled_counter();
+  static void increment_disabled_counter();
+
 private:
-  char _error_message[BUFSIZ];
   in_port_t _port;
   char _instance[1024];
-  int _line;
-  const char*  _file;
-  const char* _func;
 };
 
 
diff --git a/libtest/formatter.cc b/libtest/formatter.cc
new file mode 100644 (file)
index 0000000..f19404d
--- /dev/null
@@ -0,0 +1,191 @@
+/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ *  Data Differential YATL (i.e. libtest)  library
+ *
+ *  Copyright (C) 2012 Data Differential, http://datadifferential.com/
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *
+ *      * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *
+ *      * Redistributions in binary form must reproduce the above
+ *  copyright notice, this list of conditions and the following disclaimer
+ *  in the documentation and/or other materials provided with the
+ *  distribution.
+ *
+ *      * The names of its contributors may not be used to endorse or
+ *  promote products derived from this software without specific prior
+ *  written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <config.h>
+
+#include <libtest/common.h>
+
+#include <iostream>
+#include <fstream>
+  
+namespace libtest {
+
+class TestCase {
+public:
+  TestCase(const std::string& arg):
+    _name(arg),
+    _result(TEST_FAILURE)
+  {
+  }
+
+  const std::string& name() const
+  {
+    return _name;
+  }
+
+  test_return_t result() const
+  {
+    return _result;
+  }
+
+  void result(test_return_t arg)
+  {
+    _result= arg;
+  }
+
+  void result(test_return_t arg, const libtest::Timer& timer_)
+  {
+    _result= arg;
+    _timer= timer_;
+  }
+
+  const libtest::Timer& timer() const
+  {
+    return _timer;
+  }
+
+  void timer(libtest::Timer& arg)
+  {
+    _timer= arg;
+  }
+
+private:
+  std::string _name;
+  test_return_t _result;
+  libtest::Timer _timer;
+};
+
+Formatter::Formatter(const std::string& arg) :
+  _suite_name(arg)
+{
+}
+
+Formatter::~Formatter()
+{
+  for (TestCases::iterator iter= _testcases.begin(); iter != _testcases.end(); ++iter)
+  {
+    delete *iter;
+  }
+}
+
+TestCase* Formatter::current()
+{
+  return _testcases.back();
+}
+
+void Formatter::skipped()
+{
+  current()->result(TEST_SKIPPED);
+  Out << name() << "." << current()->name() <<  "\t\t\t\t\t" << "[ " << test_strerror(current()->result()) << " ]";
+
+  reset();
+}
+
+void Formatter::failed()
+{
+  assert(current());
+  current()->result(TEST_FAILURE);
+
+  Out << name() << "." << current()->name() <<  "\t\t\t\t\t" << "[ " << test_strerror(current()->result()) << " ]";
+
+  reset();
+}
+
+void Formatter::success(const libtest::Timer& timer_)
+{
+  assert(current());
+  current()->result(TEST_SUCCESS, timer_);
+
+  Out << name() << "."
+    << current()->name()
+    <<  "\t\t\t\t\t" 
+    << current()->timer() 
+    << " [ " << test_strerror(current()->result()) << " ]";
+
+  reset();
+}
+
+void Formatter::xml(libtest::Framework& framework_, std::ofstream& output)
+{
+  output << "<testsuites name=\"" << framework_.name() << "\">" << std::endl;
+  for (Suites::iterator framework_iter= framework_.suites().begin();
+       framework_iter != framework_.suites().end();
+       ++framework_iter)
+  {
+    output << "\t<testsuite name=\"" << (*framework_iter)->name() << "\"  classname=\"\" package=\"\">" << std::endl;
+
+    for (TestCases::iterator case_iter= (*framework_iter)->formatter()->testcases().begin();
+         case_iter != (*framework_iter)->formatter()->testcases().end();
+         ++case_iter)
+    {
+      output << "\t\t<testcase name=\"" 
+        << (*case_iter)->name() 
+        << "\" time=\"" 
+        << (*case_iter)->timer().elapsed_milliseconds() 
+        << "\">" 
+        << std::endl;
+
+      switch ((*case_iter)->result())
+      {
+        case TEST_SKIPPED:
+        output << "\t\t <skipped/>" << std::endl;
+        break;
+
+        case TEST_FAILURE:
+        output << "\t\t <failure message=\"\" type=\"\"/>"<< std::endl;
+        break;
+
+        case TEST_SUCCESS:
+        break;
+      }
+      output << "\t\t</testcase>" << std::endl;
+    }
+    output << "\t</testsuite>" << std::endl;
+  }
+  output << "</testsuites>" << std::endl;
+}
+
+void Formatter::push_testcase(const std::string& arg)
+{
+  assert(_suite_name.empty() == false);
+  TestCase* _current_testcase= new TestCase(arg);
+  _testcases.push_back(_current_testcase);
+}
+
+void Formatter::reset()
+{
+}
+} // namespace libtest
diff --git a/libtest/formatter.hpp b/libtest/formatter.hpp
new file mode 100644 (file)
index 0000000..be80d5a
--- /dev/null
@@ -0,0 +1,85 @@
+/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ *  Data Differential YATL (i.e. libtest)  library
+ *
+ *  Copyright (C) 2012 Data Differential, http://datadifferential.com/
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *
+ *      * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *
+ *      * Redistributions in binary form must reproduce the above
+ *  copyright notice, this list of conditions and the following disclaimer
+ *  in the documentation and/or other materials provided with the
+ *  distribution.
+ *
+ *      * The names of its contributors may not be used to endorse or
+ *  promote products derived from this software without specific prior
+ *  written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#include <string>
+
+namespace libtest { class Framework; }
+
+
+namespace libtest {
+
+class TestCase;
+typedef std::vector<libtest::TestCase*> TestCases;
+
+class Formatter {
+public:
+  Formatter(const std::string& arg);
+
+  ~Formatter();
+
+  void skipped();
+
+  void failed();
+
+  void success(const libtest::Timer&);
+
+  void push_testcase(const std::string&);
+
+  const std::string& name() const
+  {
+    return _suite_name;
+  }
+
+  TestCases& testcases()
+  {
+    return _testcases;
+  }
+
+  static void xml(libtest::Framework&, std::ofstream&);
+
+private:
+  void reset();
+
+  TestCase* current();
+
+private:
+  std::string _suite_name;
+  TestCases _testcases;
+};
+
+} // namespace libtest
index daea4f4ebfa339edd0d88f3847fe30e5dfbcc999..b5ad738b2a88be1ff35ed91ab08e2c39d3f36376 100644 (file)
 #include <fnmatch.h>
 #include <iostream>
 
-using namespace libtest;
+namespace libtest {
 
 Framework::Framework(libtest::SignalThread& signal,
+                     const std::string& name_,
                      const std::string& only_run_arg,
                      const std::string& wildcard_arg) :
-  _collections(NULL),
   _total(0),
   _success(0),
   _skipped(0),
@@ -61,11 +61,15 @@ Framework::Framework(libtest::SignalThread& signal,
   _creators_ptr(NULL),
   _signal(signal),
   _only_run(only_run_arg),
-  _wildcard(wildcard_arg)
+  _wildcard(wildcard_arg),
+  _name(name_)
 {
   get_world(this);
+}
 
-  for (collection_st *next= _collections; next and next->name; next++)
+void Framework::collections(collection_st* collections_)
+{
+  for (collection_st *next= collections_; next and next->name; next++)
   {
     _collection.push_back(new Collection(this, next));
   }
@@ -114,7 +118,8 @@ void Framework::exec()
 
     _total++;
 
-    try {
+    try
+    {
       switch ((*iter)->exec())
       {
       case TEST_FAILURE:
@@ -140,7 +145,7 @@ void Framework::exec()
     catch (libtest::disconnected& e)
     {
       _failed++;
-      Error << "Unhandled disconnection occurred:" << e.what();
+      stream::cerr(e.file(), e.line(), e.func()) << "Unhandled disconnection occurred: " << e.mesg();
       throw;
     }
     catch (...)
@@ -148,9 +153,9 @@ void Framework::exec()
       _failed++;
       throw;
     }
-
-    Outn();
   }
+
+  void xml(const std::string& testsuites_name, std::ostream& output);
 }
 
 uint32_t Framework::sum_total()
@@ -226,3 +231,5 @@ test_return_t Framework::create()
 
   return rc;
 }
+
+} // namespace libtest
index da1d5b9878ed2b28a4ac5451a10050778fe8b440..f6dfc94a4be3ed6a6a18cb1528e03d253231fcc0 100644 (file)
 
 #include <vector>
 
+namespace { class Collection; }
+typedef std::vector<libtest::Collection*> Suites;
+
+namespace libtest {
+
 class Framework {
 public:
 
 public:
   test_return_t create();
 
+  const std::string& name() const
+  {
+    return _name;
+  }
+
   void create(test_callback_create_fn* arg)
   {
     _create= arg;
@@ -62,10 +72,7 @@ public:
     _destroy= arg;
   }
 
-  void collections(collection_st* arg)
-  {
-    _collections= arg;
-  }
+  void collections(collection_st* arg);
 
   void set_on_error(test_callback_error_fn *arg)
   {
@@ -100,11 +107,10 @@ public:
 
   libtest::Collection& collection();
 
-  Framework(libtest::SignalThread&, const std::string&);
-
   virtual ~Framework();
 
   Framework(libtest::SignalThread&,
+            const std::string&,
             const std::string&,
             const std::string&);
 
@@ -150,11 +156,14 @@ public:
     return _failed;
   }
 
+  Suites& suites()
+  {
+    return _collection;
+  }
+
 private:
   Framework& operator=(const Framework&);
 
-  collection_st *_collections;
-
   uint32_t _total;
   uint32_t _success;
   uint32_t _skipped;
@@ -179,8 +188,11 @@ private:
   bool _socket;
   void *_creators_ptr;
   unsigned long int _servers_to_run;
-  std::vector<libtest::Collection*> _collection;
+  Suites _collection;
   libtest::SignalThread& _signal;
   std::string _only_run;
   std::string _wildcard;
+  std::string _name;
 };
+
+} // namespace libtest
index e25cdf7479ac860ff43b916a46b4439342abe3e3..f6dbdfce70ff23178b330c854649db695d75c9d3 100644 (file)
@@ -93,7 +93,7 @@ public:
       
       if (out_of_ban_killed() == false)
       {
-        Error << hostname().c_str() << ":" << port() << " was " << gearman_strerror(rc) << " extended: " << gearman_client_error(client);
+        Error << hostname().c_str() << ":" << port() << " " << gearman_client_error(client);
       }
     }
     else
index b0d4801be907e02ccc953fe9c04fbe34302302d5..e21ac0a4474f9af8557121f77477f305fe9bd845 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
 
   /* How we make all of this work :) */
   LIBTEST_API
-    void get_world(Framework *world);
+    void get_world(libtest::Framework *world);
 
 #ifdef __cplusplus
 }
index ba4bbfc65efd6af1aa31db34f11c9b3141bfee99..accadf9839bbf9a1973196d91d001dd1a79aff13 100644 (file)
@@ -64,8 +64,10 @@ bool has_libdrizzle(void)
 
 bool has_postgres_support(void)
 {
-  if (getenv("POSTGES_IS_RUNNING_AND_SETUP"))
+  char *getenv_ptr;
+  if (bool((getenv_ptr= getenv("POSTGES_IS_RUNNING_AND_SETUP"))))
   {
+    (void)(getenv_ptr);
     if (HAVE_LIBPQ)
     {
       return true;
@@ -80,11 +82,14 @@ bool has_gearmand()
 {
   if (HAVE_GEARMAND_BINARY)
   {
+#if defined(HAVE_GEARMAND_BINARY) && HAVE_GEARMAND_BINARY
     std::stringstream arg_buffer;
 
-    if (getenv("PWD") and strcmp(MEMCACHED_BINARY, "gearmand/gearmand") == 0)
+    char *getenv_ptr;
+    if (bool((getenv_ptr= getenv("PWD"))) and 
+        ((strcmp(GEARMAND_BINARY, "./gearmand/gearmand") == 0) or (strcmp(GEARMAND_BINARY, "gearmand/gearmand") == 0)))
     {
-      arg_buffer << getenv("PWD");
+      arg_buffer << getenv_ptr;
       arg_buffer << "/";
     }
     arg_buffer << GEARMAND_BINARY;
@@ -93,6 +98,7 @@ bool has_gearmand()
     {
       return true;
     }
+#endif
   }
 
   return false;
@@ -100,6 +106,7 @@ bool has_gearmand()
 
 bool has_drizzled()
 {
+#if defined(HAVE_DRIZZLED_BINARY) && HAVE_DRIZZLED_BINARY
   if (HAVE_DRIZZLED_BINARY)
   {
     if (access(DRIZZLED_BINARY, X_OK) == 0)
@@ -107,12 +114,14 @@ bool has_drizzled()
       return true;
     }
   }
+#endif
 
   return false;
 }
 
 bool has_mysqld()
 {
+#if defined(HAVE_MYSQLD_BUILD) && HAVE_MYSQLD_BUILD
   if (HAVE_MYSQLD_BUILD)
   {
     if (access(MYSQLD_BINARY, X_OK) == 0)
@@ -120,6 +129,7 @@ bool has_mysqld()
       return true;
     }
   }
+#endif
 
   return false;
 }
@@ -130,9 +140,11 @@ bool has_memcached()
   {
     std::stringstream arg_buffer;
 
-    if (getenv("PWD") and strcmp(MEMCACHED_BINARY, "memcached/memcached") == 0)
+
+    char *getenv_ptr;
+    if (bool((getenv_ptr= getenv("PWD"))) and strcmp(MEMCACHED_BINARY, "memcached/memcached") == 0)
     {
-      arg_buffer << getenv("PWD");
+      arg_buffer << getenv_ptr;
       arg_buffer << "/";
     }
     arg_buffer << MEMCACHED_BINARY;
index d7faf19d90d44508feea535e04ff565d5b26f158..0af12925f1d730b8b7a04d733d31577b9cf3c9b0 100644 (file)
@@ -96,6 +96,8 @@ extern "C" size_t
 
 static void init(CURL *curl, const std::string& url)
 {
+  (void)curl;
+  (void)url;
   if (HAVE_LIBCURL)
   {
 #if defined(HAVE_LIBCURL) && HAVE_LIBCURL
@@ -132,7 +134,7 @@ bool GET::execute()
 
     curl_easy_cleanup(curl);
 
-    return retref == CURLE_OK;
+    return bool(retref == CURLE_OK);
 #endif
   }
 
@@ -155,6 +157,8 @@ bool POST::execute()
     curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, _response);
 
     curl_easy_cleanup(curl);
+
+    return bool(retref == CURLE_OK);
 #endif
   }
 
index 240104b360900884a8c9aaa188555a7c70e33e3d..682782181cc6a7a3609f04c0b50eff842128da02 100644 (file)
@@ -36,6 +36,8 @@
 
 #pragma once
 
+#include <libtest/vchar.hpp>
+
 namespace libtest {
 namespace http {
 
index 7f6b6a3fdbdbfe30166976ed57bdec42472eaef9..28c89c59e840dda6e9c12cafc5168b3feb607203 100644 (file)
@@ -9,6 +9,7 @@ VALGRIND_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --error-exitcode=1 --leak-che
 VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND)
 HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes
 DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd
+MASSIF_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=massif
 GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb
 PTRCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-ptrcheck --error-exitcode=1
 
@@ -38,6 +39,7 @@ CLEANFILES+= tmp_chroot/var/drizzle/*
 CLEANFILES+= tmp_chroot/var/log/*
 CLEANFILES+= tmp_chroot/var/run/*
 CLEANFILES+= tmp_chroot/var/tmp/*
+CLEANFILES+= tmp_chroot/*.xml
 
 BUILT_SOURCES+= libtest/version.h
 
@@ -45,6 +47,7 @@ BUILT_SOURCES+= libtest/version.h
 distclean-libtest-check:
        -rm -rf tmp_chroot
 
+noinst_HEADERS+= libtest/formatter.hpp
 noinst_HEADERS+= libtest/timer.hpp
 noinst_HEADERS+= libtest/binaries.h 
 noinst_HEADERS+= libtest/cpu.hpp 
@@ -106,6 +109,7 @@ libtest_libtest_la_SOURCES+= libtest/core.cc
 libtest_libtest_la_SOURCES+= libtest/cpu.cc 
 libtest_libtest_la_SOURCES+= libtest/dream.cc 
 libtest_libtest_la_SOURCES+= libtest/fatal.cc 
+libtest_libtest_la_SOURCES+= libtest/formatter.cc 
 libtest_libtest_la_SOURCES+= libtest/framework.cc 
 libtest_libtest_la_SOURCES+= libtest/has.cc 
 libtest_libtest_la_SOURCES+= libtest/drizzled.cc 
@@ -228,7 +232,7 @@ test-unittest: libtest/unittest
        @libtest/unittest
 
 valgrind-unittest: libtest/unittest
-       @$(VALGRIND_COMMAND) libtest/unittest TESTS_ENVIRONMENT="valgrind"
+       @$(VALGRIND_COMMAND) libtest/unittest
 
 gdb-unittest: libtest/unittest
        @$(GDB_COMMAND) libtest/unittest
index 453d29668afdfb45d7f2cdd5f07182dcb6535d28..6bffa84cf86688a6be22fa55fcd47153375287f4 100644 (file)
@@ -43,6 +43,7 @@
 #include <ctime>
 #include <fnmatch.h>
 #include <iostream>
+#include <fstream>
 #include <memory>
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -58,7 +59,7 @@
 
 using namespace libtest;
 
-static void stats_print(Framework *frame)
+static void stats_print(libtest::Framework *frame)
 {
   if (frame->failed() == 0 and frame->success() == 0)
   {
@@ -87,6 +88,23 @@ int main(int argc, char *argv[])
   bool opt_quiet= false;
   std::string collection_to_run;
   std::string wildcard;
+  std::string binary_name;
+
+  const char *just_filename= rindex(argv[0], '/');
+  if (just_filename)
+  {
+    just_filename++;
+  }
+  else
+  {
+    just_filename= argv[0];
+  }
+
+  if (just_filename[0] == 'l' and just_filename[1] == 't' and  just_filename[2] == '-')
+  {
+    just_filename+= 3;
+  }
+  binary_name.append(just_filename);
 
   /*
     Valgrind does not currently work reliably, or sometimes at all, on OSX
@@ -202,22 +220,22 @@ int main(int argc, char *argv[])
     is_massive(opt_massive);
   }
 
-  char buffer[1024];
+  char tmp_directory[1024];
   if (getenv("LIBTEST_TMP"))
   {
-    snprintf(buffer, sizeof(buffer), "%s", getenv("LIBTEST_TMP"));
+    snprintf(tmp_directory, sizeof(tmp_directory), "%s", getenv("LIBTEST_TMP"));
   }
   else
   {
-    snprintf(buffer, sizeof(buffer), "%s", LIBTEST_TEMP);
+    snprintf(tmp_directory, sizeof(tmp_directory), "%s", LIBTEST_TEMP);
   }
 
-  if (chdir(buffer) == -1)
+  if (chdir(tmp_directory) == -1)
   {
     char getcwd_buffer[1024];
     char *dir= getcwd(getcwd_buffer, sizeof(getcwd_buffer));
 
-    Error << "Unable to chdir() from " << dir << " to " << buffer << " errno:" << strerror(errno);
+    Error << "Unable to chdir() from " << dir << " to " << tmp_directory << " errno:" << strerror(errno);
     return EXIT_FAILURE;
   }
 
@@ -261,7 +279,7 @@ int main(int argc, char *argv[])
         return EXIT_FAILURE;
       }
 
-      std::auto_ptr<Framework> frame(new Framework(signal, collection_to_run, wildcard));
+      std::auto_ptr<libtest::Framework> frame(new libtest::Framework(signal, binary_name, collection_to_run, wildcard));
 
       // Run create(), bail on error.
       {
@@ -303,11 +321,20 @@ int main(int argc, char *argv[])
       }
       else if (frame->success() and (frame->failed() == 0))
       {
+        Out;
         Out << "All tests completed successfully.";
       }
 
       stats_print(frame.get());
 
+      std::ofstream xml_file;
+      std::string file_name;
+      file_name.append(tmp_directory);
+      file_name.append(frame->name());
+      file_name.append(".xml");
+      xml_file.open(file_name.c_str(), std::ios::trunc);
+      libtest::Formatter::xml(*frame, xml_file);
+
       Outn(); // Generate a blank to break up the messages if make check/test has been run
     } while (exit_code == EXIT_SUCCESS and --opt_repeat);
   }
@@ -316,6 +343,11 @@ int main(int argc, char *argv[])
     std::cerr << "FATAL:" << e.what() << std::endl;
     exit_code= EXIT_FAILURE;
   }
+  catch (libtest::start& e)
+  {
+    std::cerr << "Failure to start:" << e.what() << std::endl;
+    exit_code= EXIT_FAILURE;
+  }
   catch (libtest::disconnected& e)
   {
     std::cerr << "Unhandled disconnection occurred:" << e.what() << std::endl;
index d92944f6bfeb1bd9cec17320229cd880f3edb6f6..37a3102eab96b448fb3db10e7abbdc2d0c90d59f 100644 (file)
@@ -375,7 +375,7 @@ bool Memcached::build(size_t argc, const char *argv[])
     add_option(sasl());
   }
 
-  for (int x= 0 ; x < argc ; x++)
+  for (size_t x= 0 ; x < argc ; x++)
   {
     add_option(argv[x]);
   }
index bded6abcd18dca29fb39bbd98823492a18533834..55cef532c27b49d49eb1aeb4628d464d4eb714b6 100644 (file)
@@ -40,6 +40,8 @@
 
 #pragma once
 
+#define LIBTEST_FAIL_PORT 23
+
 namespace libtest {
 
 LIBTEST_API
index 61f8e9835cb29f9e48c6e613a8b8609a6c2d97ab..6542fd3fc6c474798e5a122df6dbd4df48d79128 100644 (file)
@@ -178,6 +178,12 @@ bool Server::start()
   }
 #endif
 
+  if (port() == LIBTEST_FAIL_PORT)
+  {
+    throw libtest::start(LIBYATL_DEFAULT_PARAM,
+                         hostname(), port(), "Called failure");
+  }
+
   if (getenv("YATL_PTRCHECK_SERVER"))
   {
     _app.use_ptrcheck();
@@ -189,15 +195,16 @@ bool Server::start()
 
   if (args(_app) == false)
   {
-    Error << "Could not build command()";
-    return false;
+    throw libtest::start(LIBYATL_DEFAULT_PARAM,
+                         hostname(), port(), "Could not build command()");
   }
 
   libtest::release_port(_port);
   Application::error_t ret;
   if (Application::SUCCESS !=  (ret= _app.run()))
   {
-    Error << "Application::run() " << ret;
+    throw libtest::start(LIBYATL_DEFAULT_PARAM,
+                         hostname(), port(), "Application::run() %s", libtest::Application::toString(ret));
     return false;
   }
   _running= _app.print();
@@ -225,11 +232,12 @@ bool Server::start()
 
         char buf[PATH_MAX];
         char *getcwd_buf= getcwd(buf, sizeof(buf));
-        throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
-                             "Unable to open pidfile in %s for: %s stderr:%s",
-                             getcwd_buf ? getcwd_buf : "",
-                             _running.c_str(),
-                             _app.stderr_c_str());
+        throw libtest::start(LIBYATL_DEFAULT_PARAM,
+                                    hostname(), port(),
+                                    "Unable to open pidfile in %s for: %s stderr:%s",
+                                    getcwd_buf ? getcwd_buf : "",
+                                    _running.c_str(),
+                                    _app.stderr_c_str());
       }
     }
   }
@@ -241,7 +249,7 @@ bool Server::start()
     uint32_t waited;
     uint32_t retry;
 
-    for (waited= 0, retry= 1; ; retry++, waited+= this_wait)
+    for (waited= 0, retry= 4; ; retry++, waited+= this_wait)
     {
       if ((pinged= ping()) == true)
       {
@@ -265,40 +273,38 @@ bool Server::start()
       _app.slurp();
       if (kill_file(pid_file()) == false)
       {
-        libtest::fatal err(LIBYATL_DEFAULT_PARAM,
-                           "Failed to kill off server, waited: %u after startup occurred, when pinging failed: %.*s stderr:%.*s",
-                           this_wait,
-                           int(_running.size()), _running.c_str(),
-                           int(_app.stderr_result_length()), _app.stderr_c_str());
-
-        stream::cerr(err.file(), err.line(), err.func()) << err.what();
+        throw libtest::start(LIBYATL_DEFAULT_PARAM,
+                             hostname(), port(),
+                             "Failed to kill off server, waited: %u after startup occurred, when pinging failed: %.*s stderr:%.*s",
+                             this_wait,
+                             int(_running.size()), _running.c_str(),
+                             int(_app.stderr_result_length()), _app.stderr_c_str());
       }
       else
       {
-        libtest::fatal err(LIBYATL_DEFAULT_PARAM, 
-                           "Failed native ping(), pid: %d was alive: %s waited: %u server started, having pid_file. exec: %.*s stderr:%.*s",
+        throw libtest::start(LIBYATL_DEFAULT_PARAM, 
+                             hostname(), port(),
+                             "Failed native ping(), pid: %d was alive: %s waited: %u server started, having pid_file. exec: %.*s stderr:%.*s",
+                             int(_app.pid()),
+                             _app.check() ? "true" : "false",
+                             this_wait,
+                             int(_running.size()), _running.c_str(),
+                             int(_app.stderr_result_length()), _app.stderr_c_str());
+      }
+    }
+    else
+    {
+      throw libtest::start(LIBYATL_DEFAULT_PARAM,
+                           hostname(), port(),
+                           "Failed native ping(), pid: %d is alive: %s waited: %u server started. exec: %.*s stderr:%.*s",
                            int(_app.pid()),
                            _app.check() ? "true" : "false",
                            this_wait,
                            int(_running.size()), _running.c_str(),
                            int(_app.stderr_result_length()), _app.stderr_c_str());
-
-        stream::cerr(err.file(), err.line(), err.func()) << err.what();
-      }
-    }
-    else
-    {
-      libtest::fatal err(LIBYATL_DEFAULT_PARAM,
-                         "Failed native ping(), pid: %d is alive: %s waited: %u server started. exec: %.*s stderr:%.*s",
-                         int(_app.pid()),
-                         _app.check() ? "true" : "false",
-                         this_wait,
-                         int(_running.size()), _running.c_str(),
-                         int(_app.stderr_result_length()), _app.stderr_c_str());
-
-      stream::cerr(err.file(), err.line(), err.func()) << err.what();
     }
     _running.clear();
+
     return false;
   }
 
index fa98c7399e925c760de902694f380a26b4ebf133..2d7655bcffbdba6f717f140b62c7f31a03551793 100644 (file)
@@ -311,6 +311,18 @@ bool server_startup_st::start_server(const std::string& server_type, in_port_t t
       }
     }
   }
+  catch (libtest::start err)
+  {
+    stream::cerr(err.file(), err.line(), err.func()) << err.what();
+    delete server;
+    return false;
+  }
+  catch (libtest::disconnected err)
+  {
+    stream::cerr(err.file(), err.line(), err.func()) << err.what();
+    delete server;
+    return false;
+  }
   catch (...)
   {
     delete server;
index 354e2db134723eea9d9f79a1cf3b1fb29ea1ab97..dae333261ce61ff0c58271a93f7af9ed864ba542 100644 (file)
@@ -51,7 +51,7 @@ static void *world_create(server_startup_st&, test_return_t& rc)
   return NULL;
 }
 
-void get_world(Framework *world)
+void get_world(libtest::Framework *world)
 {
   world->create(world_create);
 }
index 5c449ab02f9e3c0341b4c1638f3f70f83c93fa3d..78cdb4e444ebfbbce220e5bd2ba9c55a06f83367 100644 (file)
@@ -170,7 +170,7 @@ do \
 #define test_zero(__actual) \
 do \
 { \
-  if (not libtest::_compare_zero(__FILE__, __LINE__, __func__, ((__actual)))) \
+  if (libtest::_compare_zero(__FILE__, __LINE__, __func__, ((__actual))) == false) \
   { \
     libtest::create_core(); \
     return TEST_FAILURE; \
index 3d85b77d6186e3731c065ceaf55d05001523a56a..6b3efe95cbce9d0beff090769c13ad7c01813444 100644 (file)
@@ -270,7 +270,7 @@ static test_return_t drizzled_cycle_test(void *object)
 
   test_skip(true, has_drizzled());
 
-  test_true(server_startup(*servers, "drizzled", get_free_port(), 0, NULL));
+  test_skip(true, server_startup(*servers, "drizzled", get_free_port(), 0, NULL));
 
   return TEST_SUCCESS;
 }
@@ -286,11 +286,12 @@ static test_return_t gearmand_cycle_test(void *object)
 
   test_skip(true, has_gearmand());
 
-  test_true(server_startup(*servers, "gearmand", get_free_port(), 0, NULL));
+  test_skip(true, server_startup(*servers, "gearmand", get_free_port(), 0, NULL));
 
   return TEST_SUCCESS;
 }
 
+#if 0
 static test_return_t memcached_light_cycle_TEST(void *object)
 {
   server_startup_st *servers= (server_startup_st*)object;
@@ -302,6 +303,7 @@ static test_return_t memcached_light_cycle_TEST(void *object)
 
   return TEST_SUCCESS;
 }
+#endif
 
 static test_return_t skip_shim(bool a, bool b)
 {
@@ -309,7 +311,7 @@ static test_return_t skip_shim(bool a, bool b)
   return TEST_SUCCESS;
 }
 
-static test_return_t test_skip_true_TEST(void *object)
+static test_return_t test_skip_true_TEST(void*)
 {
   test_compare(true, true);
   test_compare(false, false);
@@ -319,13 +321,23 @@ static test_return_t test_skip_true_TEST(void *object)
   return TEST_SUCCESS;
 }
 
-static test_return_t test_skip_false_TEST(void *object)
+static test_return_t test_skip_false_TEST(void*)
 {
   test_compare(TEST_SKIPPED, skip_shim(true, false));
   test_compare(TEST_SKIPPED, skip_shim(false, true));
   return TEST_SUCCESS;
 }
 
+static test_return_t server_startup_fail_TEST(void *object)
+{
+  server_startup_st *servers= (server_startup_st*)object;
+  test_true(servers);
+
+  test_compare(servers->start_server(testing_service, LIBTEST_FAIL_PORT, 0, NULL, true), false);
+
+  return TEST_SUCCESS;
+}
+
 static test_return_t server_startup_TEST(void *object)
 {
   server_startup_st *servers= (server_startup_st*)object;
@@ -359,6 +371,7 @@ static test_return_t socket_server_startup_TEST(void *object)
   return TEST_SUCCESS;
 }
 
+#if 0
 static test_return_t memcached_sasl_test(void *object)
 {
   server_startup_st *servers= (server_startup_st*)object;
@@ -379,6 +392,7 @@ static test_return_t memcached_sasl_test(void *object)
 
   return TEST_SKIPPED;
 }
+#endif
 
 static test_return_t application_true_BINARY(void *)
 {
@@ -422,7 +436,7 @@ static test_return_t application_true_fubar_BINARY(void *)
   const char *args[]= { "--fubar", 0 };
   test_compare(Application::SUCCESS, true_app.run(args));
   test_compare(Application::SUCCESS, true_app.wait());
-  test_compare(0, true_app.stdout_result().size());
+  test_zero(true_app.stdout_result().size());
 
   return TEST_SUCCESS;
 }
@@ -442,7 +456,7 @@ static test_return_t application_doesnotexist_BINARY(void *)
   test_compare(Application::INVALID, true_app.wait(false));
 #endif
 
-  test_compare(0, true_app.stdout_result().size());
+  test_zero(true_app.stdout_result().size());
 
   return TEST_SUCCESS;
 }
@@ -454,7 +468,7 @@ static test_return_t application_true_fubar_eq_doh_BINARY(void *)
   const char *args[]= { "--fubar=doh", 0 };
   test_compare(Application::SUCCESS, true_app.run(args));
   test_compare(Application::SUCCESS, true_app.wait());
-  test_compare(0, true_app.stdout_result().size());
+  test_zero(true_app.stdout_result().size());
 
   return TEST_SUCCESS;
 }
@@ -467,7 +481,7 @@ static test_return_t application_true_fubar_eq_doh_option_BINARY(void *)
 
   test_compare(Application::SUCCESS, true_app.run());
   test_compare(Application::SUCCESS, true_app.wait());
-  test_compare(0, true_app.stdout_result().size());
+  test_zero(true_app.stdout_result().size());
 
   return TEST_SUCCESS;
 }
@@ -547,7 +561,7 @@ static test_return_t application_echo_fubar_BINARY2(void *)
   true_app.add_option("fubar");
 
   test_compare(Application::SUCCESS, true_app.run());
-  test_compare(Application::SUCCESS, true_app.wait(false));
+  test_compare(Application::SUCCESS, true_app.join());
 
   libtest::vchar_t response;
   make_vector(response, test_literal_param("fubar\n"));
@@ -766,7 +780,7 @@ static test_return_t create_tmpfile_TEST(void *)
   Application touch_app("touch");
   const char *args[]= { tmp.c_str(), 0 };
   test_compare(Application::SUCCESS, touch_app.run(args));
-  test_compare(Application::SUCCESS, touch_app.wait(false));
+  test_compare(Application::SUCCESS, touch_app.join());
 
   test_compare(0, access(tmp.c_str(), R_OK));
   test_compare(0, unlink(tmp.c_str()));
@@ -795,6 +809,9 @@ static test_return_t check_for_gearman(void *)
 {
   test_skip(true, HAVE_LIBGEARMAN);
   test_skip(true, has_gearmand());
+
+  testing_service= "gearmand";
+
   return TEST_SUCCESS;
 }
 
@@ -802,6 +819,9 @@ static test_return_t check_for_drizzle(void *)
 {
   test_skip(true, HAVE_LIBDRIZZLE);
   test_skip(true, has_drizzled());
+
+  testing_service= "drizzled";
+
   return TEST_SUCCESS;
 }
 
@@ -817,6 +837,7 @@ test_st gearmand_tests[] ={
 #endif
   {"gearmand startup-shutdown", 0, gearmand_cycle_test },
   {"_compare(gearman_return_t)", 0, _compare_gearman_return_t_test },
+  {"server_startup(fail)", 0, server_startup_fail_TEST },
   {0, 0, 0}
 };
 
@@ -838,6 +859,7 @@ test_st memcached_TESTS[] ={
   {"memcached startup-shutdown", 0, server_startup_TEST },
   {"memcached(socket file) startup-shutdown", 0, socket_server_startup_TEST },
   {"_compare(memcached_return_t)", 0, _compare_memcached_return_t_test },
+  {"server_startup(fail)", 0, server_startup_fail_TEST },
   {0, 0, 0}
 };
 
@@ -1007,7 +1029,7 @@ static void *world_create(server_startup_st& servers, test_return_t&)
   return &servers;
 }
 
-void get_world(Framework *world)
+void get_world(libtest::Framework *world)
 {
   world->collections(collection);
   world->create(world_create);
diff --git a/m4/README.md b/m4/README.md
new file mode 100644 (file)
index 0000000..ea8545f
--- /dev/null
@@ -0,0 +1,4 @@
+https://github.com/BrianAker/m4
+
+Common m4 files that I use.
+  -Brian Aker, brian@tangent.org
diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4
new file mode 100644 (file)
index 0000000..1f8e708
--- /dev/null
@@ -0,0 +1,65 @@
+# ===========================================================================
+#  http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+#   For every FLAG1, FLAG2 it is checked whether the compiler works with the
+#   flag.  If it does, the flag is added FLAGS-VARIABLE
+#
+#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+#   CFLAGS) is used.  During the check the flag is always added to the
+#   current language's flags.
+#
+#   If EXTRA-FLAGS is defined, it is added to the current language's default
+#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
+#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
+#   force the compiler to issue an error when a bad flag is given.
+#
+#   NOTE: This macro depends on the AX_APPEND_FLAG and
+#   AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
+#   AX_APPEND_LINK_FLAGS.
+#
+# LICENSE
+#
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 3
+
+AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
+[AC_REQUIRE([AX_CHECK_COMPILE_FLAG])
+AC_REQUIRE([AX_APPEND_FLAG])
+for flag in $1; do
+  AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3])
+done
+])dnl AX_APPEND_COMPILE_FLAGS
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
new file mode 100644 (file)
index 0000000..1d38b76
--- /dev/null
@@ -0,0 +1,69 @@
+# ===========================================================================
+#      http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
+#
+# DESCRIPTION
+#
+#   FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
+#   added in between.
+#
+#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+#   CFLAGS) is used.  FLAGS-VARIABLE is not changed if it already contains
+#   FLAG.  If FLAGS-VARIABLE is unset in the shell, it is set to exactly
+#   FLAG.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 2
+
+AC_DEFUN([AX_APPEND_FLAG],
+[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
+AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl
+AS_VAR_SET_IF(FLAGS,
+  [case " AS_VAR_GET(FLAGS) " in
+    *" $1 "*)
+      AC_RUN_LOG([: FLAGS already contains $1])
+      ;;
+    *)
+      AC_RUN_LOG([: FLAGS="$FLAGS $1"])
+      AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"])
+      ;;
+   esac],
+  [AS_VAR_SET(FLAGS,["$1"])])
+AS_VAR_POPDEF([FLAGS])dnl
+])dnl AX_APPEND_FLAG
diff --git a/m4/ax_append_link_flags.m4 b/m4/ax_append_link_flags.m4
new file mode 100644 (file)
index 0000000..48cbd4b
--- /dev/null
@@ -0,0 +1,63 @@
+# ===========================================================================
+#   http://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+#   For every FLAG1, FLAG2 it is checked whether the linker works with the
+#   flag.  If it does, the flag is added FLAGS-VARIABLE
+#
+#   If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
+#   used. During the check the flag is always added to the linker's flags.
+#
+#   If EXTRA-FLAGS is defined, it is added to the linker's default flags
+#   when the check is done.  The check is thus made with the flags: "LDFLAGS
+#   EXTRA-FLAGS FLAG".  This can for example be used to force the linker to
+#   issue an error when a bad flag is given.
+#
+#   NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
+#   Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
+#
+# LICENSE
+#
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 3
+
+AC_DEFUN([AX_APPEND_LINK_FLAGS],
+[AC_REQUIRE([AX_CHECK_LINK_FLAG])
+AC_REQUIRE([AX_APPEND_FLAG])
+for flag in $1; do
+  AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3])
+done
+])dnl AX_APPEND_LINK_FLAGS
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
new file mode 100644 (file)
index 0000000..c3a8d69
--- /dev/null
@@ -0,0 +1,72 @@
+# ===========================================================================
+#   http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+#   Check whether the given FLAG works with the current language's compiler
+#   or gives an error.  (Warnings, however, are ignored)
+#
+#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+#   success/failure.
+#
+#   If EXTRA-FLAGS is defined, it is added to the current language's default
+#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
+#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
+#   force the compiler to issue an error when a bad flag is given.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 2
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+    [AS_VAR_SET(CACHEVAR,[yes])],
+    [AS_VAR_SET(CACHEVAR,[no])])
+  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
+  [m4_default([$2], :)],
+  [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4
new file mode 100644 (file)
index 0000000..e2d0d36
--- /dev/null
@@ -0,0 +1,71 @@
+# ===========================================================================
+#    http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+#   Check whether the given FLAG works with the linker or gives an error.
+#   (Warnings, however, are ignored)
+#
+#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+#   success/failure.
+#
+#   If EXTRA-FLAGS is defined, it is added to the linker's default flags
+#   when the check is done.  The check is thus made with the flags: "LDFLAGS
+#   EXTRA-FLAGS FLAG".  This can for example be used to force the linker to
+#   issue an error when a bad flag is given.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+#   macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 2
+
+AC_DEFUN([AX_CHECK_LINK_FLAG],
+[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
+AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
+  ax_check_save_flags=$LDFLAGS
+  LDFLAGS="$LDFLAGS $4 $1"
+  AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+    [AS_VAR_SET(CACHEVAR,[yes])],
+    [AS_VAR_SET(CACHEVAR,[no])])
+  LDFLAGS=$ax_check_save_flags])
+AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
+  [m4_default([$2], :)],
+  [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_LINK_FLAGS
diff --git a/m4/ax_harden_compiler_flags.m4 b/m4/ax_harden_compiler_flags.m4
new file mode 100644 (file)
index 0000000..b847432
--- /dev/null
@@ -0,0 +1,72 @@
+# ===========================================================================
+#      http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_HARDEN_COMPILER_FLAGS
+#
+# DESCRIPTION
+#
+#   Any compiler flag that "hardens" or tests code.
+#
+#   NOTE: Implementation based on AX_APPEND_FLAG.
+#
+# LICENSE
+#
+#  Copyright (C) 2012 Brian Aker
+#  All rights reserved.
+#  
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions are
+#  met:
+#  
+#      * Redistributions of source code must retain the above copyright
+#  notice, this list of conditions and the following disclaimer.
+#  
+#      * Redistributions in binary form must reproduce the above
+#  copyright notice, this list of conditions and the following disclaimer
+#  in the documentation and/or other materials provided with the
+#  distribution.
+#  
+#      * The names of its contributors may not be used to endorse or
+#  promote products derived from this software without specific prior
+#  written permission.
+#  
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#serial 1
+
+AC_DEFUN([AX_HARDEN_COMPILER_FLAGS],
+[AC_REQUIRE([AX_CHECK_COMPILE_FLAG])
+AC_REQUIRE([AX_APPEND_FLAG])
+AC_REQUIRE([AX_CHECK_LINK_FLAG])
+AX_APPEND_COMPILE_FLAGS([-O2])
+AX_APPEND_COMPILE_FLAGS([-Werror])
+AX_APPEND_COMPILE_FLAGS([-Wall])
+AX_APPEND_COMPILE_FLAGS([-Wextra])
+AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized])
+AX_APPEND_COMPILE_FLAGS([-Wsign-compare])
+AX_APPEND_COMPILE_FLAGS([-Wunused-result])
+AX_APPEND_COMPILE_FLAGS([-Wunused-variable])
+AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all])
+AX_APPEND_COMPILE_FLAGS([-fstack-protector-all])
+AX_APPEND_COMPILE_FLAGS([-ggdb])
+AX_APPEND_COMPILE_FLAGS([-fstack-protector-all])
+AX_APPEND_COMPILE_FLAGS([-Wstack-protector])
+AX_APPEND_COMPILE_FLAGS([-fwrapv])
+AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2])
+AX_APPEND_COMPILE_FLAGS([--param],[ssp-buffer-size=1])
+AX_CHECK_LINK_FLAG([-Werror])
+AX_CHECK_LINK_FLAG([-z relro -z now])
+])dnl AX_HARDEN_COMPILER_FLAGS
diff --git a/m4/include.am b/m4/include.am
new file mode 100644 (file)
index 0000000..db1565e
--- /dev/null
@@ -0,0 +1,7 @@
+update_m4:
+       @rm -r -f m4.moved
+       @mv m4 m4.moved
+       @git clone git@github.com:BrianAker/m4.git
+       @bzr revert m4
+       (cd m4; git checkout .)
+       @bzr diff m4
diff --git a/memcached/README b/memcached/README
deleted file mode 100644 (file)
index f20dd8c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-Dependencies:
-
-   -- libevent, http://www.monkey.org/~provos/libevent/ (libevent-dev)
-
-If using Linux, you need a kernel with epoll.  Sure, libevent will
-work with normal select, but it sucks.
-
-epoll isn't in Linux 2.4, but there's a backport at:
-
-    http://www.xmailserver.org/linux-patches/nio-improve.html
-
-You want the epoll-lt patch (level-triggered).
-
-If you're using MacOS, you'll want libevent 1.1 or higher to deal with
-a kqueue bug.
-
-Also, be warned that the -k (mlockall) option to memcached might be
-dangerous when using a large cache.  Just make sure the memcached machines
-don't swap.  memcached does non-blocking network I/O, but not disk.  (it
-should never go to disk, or you've lost the whole point of it)
-
-The memcached website is at:
-
-    http://www.memcached.org
-
-Want to contribute?  Up-to-date pointers should be at:
-
-    http://contributing.appspot.com/memcached
diff --git a/memcached/README.md b/memcached/README.md
new file mode 100644 (file)
index 0000000..27a6896
--- /dev/null
@@ -0,0 +1,38 @@
+# Memcached
+
+## Dependencies
+
+* libevent, http://www.monkey.org/~provos/libevent/ (libevent-dev)
+
+## Environment
+
+### Linux
+
+If using Linux, you need a kernel with epoll.  Sure, libevent will
+work with normal select, but it sucks.
+
+epoll isn't in Linux 2.4, but there's a backport at:
+
+    http://www.xmailserver.org/linux-patches/nio-improve.html
+
+You want the epoll-lt patch (level-triggered).
+
+### Mac OS X
+
+If you're using MacOS, you'll want libevent 1.1 or higher to deal with
+a kqueue bug.
+
+Also, be warned that the -k (mlockall) option to memcached might be
+dangerous when using a large cache.  Just make sure the memcached machines
+don't swap.  memcached does non-blocking network I/O, but not disk.  (it
+should never go to disk, or you've lost the whole point of it)
+
+## Website
+
+* http://www.memcached.org
+
+## Contributing
+
+Want to contribute?  Up-to-date pointers should be at:
+
+* http://contributing.appspot.com/memcached
index f14d85d80a20168420f907924c5a505cd49f420f..bcaf6f2692e4b4785b4580b07ba034a2f31c089f 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "memcached.h"
-
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/signal.h>
 
 static pthread_cond_t maintenance_cond = PTHREAD_COND_INITIALIZER;
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif
-
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-#endif
 
 typedef  unsigned long  int  ub4;   /* unsigned 4-byte quantities */
 typedef  unsigned       char ub1;   /* unsigned 1-byte quantities */
@@ -243,7 +235,7 @@ static void *assoc_maintenance_thread(void *arg) {
             pthread_cond_wait(&maintenance_cond, &cache_lock);
         }
 
-        pthread_mutex_unlock(&cache_lock);
+        mutex_unlock(&cache_lock);
     }
     return NULL;
 }
@@ -271,7 +263,7 @@ void stop_assoc_maintenance_thread() {
     mutex_lock(&cache_lock);
     do_run_maintenance_thread = 0;
     pthread_cond_signal(&maintenance_cond);
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
 
     /* Wait for the maintenance thread to stop */
     pthread_join(maintenance_tid, NULL);
index c735394da8bb20c135d01bf86ecd03b5b4e0e1c6..a3a97672f82149af95e47871b0339877804b121b 100755 (executable)
@@ -39,7 +39,7 @@ $AUTOHEADER || exit 1
 
 echo "automake..."
 if test x$AUTOMAKE = x; then
-  AUTOMAKE=`locate_binary automake-1.11 automake-1.10 automake-1.9 automake-1.7`
+  AUTOMAKE=`locate_binary automake-1.12 automake-1.11 automake-1.10 automake-1.9 automake-1.7`
   if test x$AUTOMAKE = x; then
     die "Did not find a supported automake"
   fi
index 7dcf2fbb4468136ab79b4288a0b2e42216aeee7c..fcb3d2bfe1fd32083ec5401f11864df42a0e41bb 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-#include "memcached.h"
+#include <config.h>
 
 #include <stdlib.h>
 #include <string.h>
@@ -68,6 +68,7 @@ void cache_destroy(cache_t *cache) {
     free(cache->name);
     free(cache->ptr);
     pthread_mutex_destroy(&cache->mutex);
+    free(cache);
 }
 
 void* cache_alloc(cache_t *cache) {
index 2f189157633069fc8d4e2a0432e080bf631f979b..d42e5b08778df0810f4aa6cf6ef536fb534e711f 100644 (file)
  * SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #if defined __SUNPRO_C || defined __DECC || defined __HP_cc
 # pragma ident "@(#)$Header: /cvsroot/wikipedia/willow/src/bin/willow/daemon.c,v 1.1 2005/05/02 19:15:21 kateturner Exp $"
 # pragma ident "$NetBSD: daemon.c,v 1.9 2003/08/07 16:42:46 agc Exp $"
 #endif
 
-#include "memcached.h"
-
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
+#include "memcached.h"
+
 int daemonize(int nochdir, int noclose)
 {
     int fd;
index 95481ef401bcfb1825b6032622698b8d59a09d89..fe0580673ca95b87a051f9e450c1a742dea3f212 100755 (executable)
@@ -3,7 +3,7 @@ use strict;
 use FindBin qw($Bin);
 chdir "$Bin/.." or die;
 
-my @exempted = qw(Makefile.am ChangeLog doc/Makefile.am);
+my @exempted = qw(Makefile.am ChangeLog doc/Makefile.am README README.md);
 push(@exempted, glob("doc/*.xml"));
 push(@exempted, glob("doc/xml2rfc/*.xsl"));
 push(@exempted, glob("m4/*backport*m4"));
index 1a844f0aaa539b33d8488cc8df2f406fdf75a0c3..b26d9625dfb3a6ab76088ce584c0d48b60a422b1 100644 (file)
@@ -354,6 +354,8 @@ slabs reassign <source class> <dest class>\r\n
 
 - <source class> is an id number for the slab class to steal a page from
 
+A source class id of -1 means "pick from any valid class"
+
 - <dest class> is an id number for the slab class to move a page to
 
 The response line could be one of:
@@ -385,12 +387,20 @@ more details.
 
 The automover can be enabled or disabled at runtime with this command.
 
-slabs automove <1|0>
+slabs automove <0|1>
 
-- 1|0 is the indicator on whether to enable the slabs automover or not.
+- 0|1|2 is the indicator on whether to enable the slabs automover or not.
 
 The response should always be "OK\r\n"
 
+- <0> means to set the thread on standby
+
+- <1> means to run the builtin slow algorithm to choose pages to move
+
+- <2> is a highly aggressive mode which causes pages to be moved every time
+  there is an eviction. It is not recommended to run for very long in this
+  mode unless your access patterns are very well understood.
+
 Statistics
 ----------
 
@@ -406,7 +416,7 @@ settings, documented below.  In the other form it has some arguments:
 stats <args>\r\n
 
 Depending on <args>, various internal data is sent by the server. The
-kinds of arguments and the data sent are not documented in this vesion
+kinds of arguments and the data sent are not documented in this version
 of the protocol, and are subject to change for the convenience of
 memcache developers.
 
index 6c9b9b6aa5b9861e0fe207446fc0d89a003ef914..fcfc1ffcd321ed6658323fe3635b3123b6ad4a35 100644 (file)
  * whether it's big or little-endian. ENDIAN_LITTLE and ENDIAN_BIG
  * are set in the configure script.
  */
-#if defined(ENDIAN_BIG) && ENDIAN_BIG == 1
+#if ENDIAN_BIG == 1
 # define HASH_LITTLE_ENDIAN 0
 # define HASH_BIG_ENDIAN 1
 #else
-# if defined(ENDIAN_LITTLE) && ENDIAN_LITTLE == 1
+# if ENDIAN_LITTLE == 1
 #  define HASH_LITTLE_ENDIAN 1
 #  define HASH_BIG_ENDIAN 0
 # else
@@ -178,8 +178,6 @@ uint32_t hash(
     case 2 : a+=k[0]&0xffff; break;
     case 1 : a+=k[0]&0xff; break;
     case 0 : return c;  /* zero length strings require no mixing */
-    default:
-             abort();
     }
 
 #else /* make valgrind happy */
@@ -249,8 +247,6 @@ uint32_t hash(
     case 1 : a+=k8[0];
              break;
     case 0 : return c;  /* zero length strings require no mixing */
-    default:
-             abort();
     }
 
   } else {                        /* need to read the key one byte at a time */
@@ -293,8 +289,6 @@ uint32_t hash(
     case 1 : a+=k[0];
              break;
     case 0 : return c;  /* zero length strings require no mixing */
-    default:
-             abort();
     }
   }
 
index 58fc871787aae955ca21243b50c5ab26a3db5310..84011c4402a39f71eba3b097e11e6799b6f31b0a 100644 (file)
@@ -44,7 +44,7 @@ static unsigned int sizes[LARGEST_ID];
 void item_stats_reset(void) {
     mutex_lock(&cache_lock);
     memset(itemstats, 0, sizeof(itemstats));
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
 }
 
 
@@ -125,7 +125,7 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_tim
         } else if ((it = slabs_alloc(ntotal, id)) == NULL) {
             if (settings.evict_to_free == 0) {
                 itemstats[id].outofmemory++;
-                pthread_mutex_unlock(&cache_lock);
+                mutex_unlock(&cache_lock);
                 return NULL;
             }
             itemstats[id].evicted++;
@@ -146,6 +146,16 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_tim
             do_item_unlink_nolock(it, hash(ITEM_key(it), it->nkey, 0));
             /* Initialize the item block: */
             it->slabs_clsid = 0;
+
+            /* If we've just evicted an item, and the automover is set to
+             * angry bird mode, attempt to rip memory into this slab class.
+             * TODO: Move valid object detection into a function, and on a
+             * "successful" memory pull, look behind and see if the next alloc
+             * would be an eviction. Then kick off the slab mover before the
+             * eviction happens.
+             */
+            if (settings.slab_automove == 2)
+                slabs_reassign(-1, id);
         } else {
             refcount_decr(&search->refcount);
         }
@@ -171,7 +181,7 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_tim
             search->refcount = 1;
             do_item_unlink_nolock(search, hash(ITEM_key(search), search->nkey, 0));
         }
-        pthread_mutex_unlock(&cache_lock);
+        mutex_unlock(&cache_lock);
         return NULL;
     }
 
@@ -182,7 +192,7 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_tim
      * been removed from the slab LRU.
      */
     it->refcount = 1;     /* the caller will have a reference */
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
     it->next = it->prev = it->h_next = 0;
     it->slabs_clsid = id;
 
@@ -288,7 +298,7 @@ int do_item_link(item *it, const uint32_t hv) {
     assoc_insert(it, hv);
     item_link_q(it);
     refcount_incr(&it->refcount);
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
 
     return 1;
 }
@@ -306,7 +316,7 @@ void do_item_unlink(item *it, const uint32_t hv) {
         item_unlink_q(it);
         do_item_remove(it);
     }
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
 }
 
 /* FIXME: Is it necessary to keep this copy/pasted code? */
@@ -344,7 +354,7 @@ void do_item_update(item *it) {
             it->time = current_time;
             item_link_q(it);
         }
-        pthread_mutex_unlock(&cache_lock);
+        mutex_unlock(&cache_lock);
     }
 }
 
@@ -357,10 +367,6 @@ int do_item_replace(item *it, item *new_it, const uint32_t hv) {
     return do_item_link(new_it, hv);
 }
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wshadow"
-#endif
-
 /*@null@*/
 char *do_item_cachedump(const unsigned int slabs_clsid, const unsigned int limit, unsigned int *bytes) {
     unsigned int memlimit = 2 * 1024 * 1024;   /* 2MB max response size */
@@ -407,7 +413,7 @@ void item_stats_evictions(uint64_t *evicted) {
     for (i = 0; i < LARGEST_ID; i++) {
         evicted[i] = itemstats[i].evicted;
     }
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
 }
 
 void do_item_stats(ADD_STAT add_stats, void *c) {
@@ -499,7 +505,7 @@ item *do_item_get(const char *key, const size_t nkey, const uint32_t hv) {
             it = NULL;
         }
     }
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
     int was_found = 0;
 
     if (settings.verbose > 2) {
index 10374421c39f8b068e8cc221a39c7ef8e9ba125e..2cb0b2069028f91e62473a3869e0699ffe0d59bb 100644 (file)
@@ -125,9 +125,6 @@ static enum transmit_result transmit(conn *c);
  */
 static volatile bool allow_new_conns = true;
 static struct event maxconnsevent;
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-#endif
 static void maxconns_handler(const int fd, const short which, void *arg) {
     struct timeval t = {.tv_sec = 0, .tv_usec = 10000};
 
@@ -227,7 +224,7 @@ static void settings_init(void) {
     settings.maxconns_fast = false;
     settings.hashpower_init = 0;
     settings.slab_reassign = false;
-    settings.slab_automove = false;
+    settings.slab_automove = 0;
 }
 
 /*
@@ -336,7 +333,7 @@ bool conn_add_to_freelist(conn *c) {
 }
 
 static const char *prot_text(enum protocol prot) {
-    const char *rv = "unknown";
+    char *rv = "unknown";
     switch(prot) {
         case ascii_prot:
             rv = "ascii";
@@ -347,8 +344,6 @@ static const char *prot_text(enum protocol prot) {
         case negotiating_prot:
             rv = "auto-negotiate";
             break;
-        default:
-            abort();
     }
     return rv;
 }
@@ -639,9 +634,6 @@ static const char *state_text(enum conn_states state) {
     return statenames[state];
 }
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wtype-limits"
-#endif
 /*
  * Sets a connection's current state in the state machine. Any special
  * processing that needs to happen on certain state transitions can
@@ -791,9 +783,6 @@ static int build_udp_headers(conn *c) {
 }
 
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wsign-compare"
-#endif
 static void out_string(conn *c, const char *str) {
     size_t len;
 
@@ -1000,10 +989,6 @@ static void write_bin_error(conn *c, protocol_binary_response_status err, int sw
     case PROTOCOL_BINARY_RESPONSE_AUTH_ERROR:
         errstr = "Auth failure.";
         break;
-    case PROTOCOL_BINARY_RESPONSE_AUTH_CONTINUE:
-        assert(false);
-    case PROTOCOL_BINARY_RESPONSE_SUCCESS:
-        assert(false);
     default:
         assert(false);
         errstr = "UNHANDLED ERROR";
@@ -1029,7 +1014,7 @@ static void write_bin_error(conn *c, protocol_binary_response_status err, int sw
 }
 
 /* Form and send a response to a command over the binary protocol */
-static void write_bin_response(conn *c, const void *d, int hlen, int keylen, int dlen) {
+static void write_bin_response(conn *c, void *d, int hlen, int keylen, int dlen) {
     if (!c->noreply || c->cmd == PROTOCOL_BINARY_CMD_GET ||
         c->cmd == PROTOCOL_BINARY_CMD_GETK) {
         add_bin_header(c, 0, hlen, keylen, dlen);
@@ -1133,10 +1118,6 @@ static void complete_incr_bin(conn *c) {
     case DELTA_ITEM_CAS_MISMATCH:
         write_bin_error(c, PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS, 0);
         break;
-
-    default:
-        assert(0);
-        abort();
     }
 }
 
@@ -1204,9 +1185,6 @@ static void complete_update_bin(conn *c) {
             eno = PROTOCOL_BINARY_RESPONSE_NOT_STORED;
         }
         write_bin_error(c, eno, 0);
-    default:
-        assert(false);
-        abort();
     }
 
     item_remove(c->item);       /* release the c->item reference */
@@ -1219,8 +1197,8 @@ static void process_bin_touch(conn *c) {
     protocol_binary_response_get* rsp = (protocol_binary_response_get*)c->wbuf;
     char* key = binary_get_key(c);
     size_t nkey = c->binary_header.request.keylen;
-    protocol_binary_request_touch *t = (void *)&c->binary_header;
-    uint32_t exptime = ntohl(t->message.body.expiration);
+    protocol_binary_request_touch *t = binary_get_request(c);
+    time_t exptime = ntohl(t->message.body.expiration);
 
     if (settings.verbose > 1) {
         int ii;
@@ -1387,9 +1365,6 @@ static void process_bin_get(conn *c) {
     }
 }
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-#endif
 static void append_bin_stats(const char *key, const uint16_t klen,
                              const char *val, const uint32_t vlen,
                              conn *c) {
@@ -1397,14 +1372,11 @@ static void append_bin_stats(const char *key, const uint16_t klen,
     uint32_t bodylen = klen + vlen;
     protocol_binary_response_header header = {
         .response.magic = (uint8_t)PROTOCOL_BINARY_RES,
-        .response.opcode = (uint8_t)PROTOCOL_BINARY_CMD_STAT,
+        .response.opcode = PROTOCOL_BINARY_CMD_STAT,
         .response.keylen = (uint16_t)htons(klen),
-        .response.extlen = (uint8_t)0,
         .response.datatype = (uint8_t)PROTOCOL_BINARY_RAW_BYTES,
-        .response.status = (uint16_t)0,
         .response.bodylen = htonl(bodylen),
-        .response.opaque = c->opaque,
-        .response.cas = (uint64_t)0
+        .response.opaque = c->opaque
     };
 
     memcpy(buf, header.bytes, sizeof(header.response));
@@ -1887,7 +1859,7 @@ static void dispatch_bin_command(conn *c) {
     switch (c->cmd) {
         case PROTOCOL_BINARY_CMD_VERSION:
             if (extlen == 0 && keylen == 0 && bodylen == 0) {
-                write_bin_response(c, RVERSION, 0, 0, strlen(RVERSION));
+                write_bin_response(c, VERSION, 0, 0, strlen(VERSION));
             } else {
                 protocol_error = 1;
             }
@@ -2246,10 +2218,6 @@ static void complete_nread_binary(conn *c) {
     case bin_reading_sasl_auth_data:
         process_bin_complete_sasl_auth(c);
         break;
-    case bin_reading_cas_header:
-        assert(0);
-    case bin_no_state:
-        assert(0);
     default:
         fprintf(stderr, "Not handling substate %d\n", c->substate);
         assert(0);
@@ -2568,7 +2536,7 @@ static void server_stats(ADD_STAT add_stats, conn *c) {
     APPEND_STAT("pid", "%lu", (long)pid);
     APPEND_STAT("uptime", "%u", now);
     APPEND_STAT("time", "%ld", now + (long)process_started);
-    APPEND_STAT("version", "%s", RVERSION);
+    APPEND_STAT("version", "%s", VERSION);
     APPEND_STAT("libevent", "%s", event_get_version());
     APPEND_STAT("pointer_size", "%d", (int)(8 * sizeof(void *)));
 
@@ -2656,7 +2624,7 @@ static void process_stat_settings(ADD_STAT add_stats, void *c) {
     APPEND_STAT("maxconns_fast", "%s", settings.maxconns_fast ? "yes" : "no");
     APPEND_STAT("hashpower_init", "%d", settings.hashpower_init);
     APPEND_STAT("slab_reassign", "%s", settings.slab_reassign ? "yes" : "no");
-    APPEND_STAT("slab_automove", "%s", settings.slab_automove ? "yes" : "no");
+    APPEND_STAT("slab_automove", "%d", settings.slab_automove);
 }
 
 static void process_stat(conn *c, token_t *tokens, const size_t ntokens) {
@@ -2735,9 +2703,6 @@ static void process_stat(conn *c, token_t *tokens, const size_t ntokens) {
     }
 }
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
-#endif
 /* ntokens is overwritten here... shrug.. */
 static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens, bool return_cas) {
     char *key;
@@ -3072,9 +3037,6 @@ static void process_arithmetic_command(conn *c, token_t *tokens, const size_t nt
         break;
     case DELTA_ITEM_CAS_MISMATCH:
         break; /* Should never get here */
-    default:
-        assert(false);
-        abort();
     }
 }
 
@@ -3156,7 +3118,7 @@ enum delta_result_type do_add_delta(conn *c, const char *key, const size_t nkey,
            need to update the CAS on the existing item. */
         mutex_lock(&cache_lock); /* FIXME */
         ITEM_set_cas(it, (settings.use_cas) ? get_cas_id() : 0);
-        pthread_mutex_unlock(&cache_lock);
+        mutex_unlock(&cache_lock);
 
         memcpy(ITEM_data(it), buf, res);
         memset(ITEM_data(it) + res, ' ', it->nbytes - res - 2);
@@ -3244,9 +3206,9 @@ static void process_slabs_automove_command(conn *c, token_t *tokens, const size_
 
     level = strtoul(tokens[2].value, NULL, 10);
     if (level == 0) {
-        settings.slab_automove = false;
-    } else if (level == 1) {
-        settings.slab_automove = true;
+        settings.slab_automove = 0;
+    } else if (level == 1 || level == 2) {
+        settings.slab_automove = level;
     } else {
         out_string(c, "ERROR");
         return;
@@ -3363,7 +3325,7 @@ static void process_command(conn *c, char *command) {
 
     } else if (ntokens == 2 && (strcmp(tokens[COMMAND_TOKEN].value, "version") == 0)) {
 
-        out_string(c, "VERSION " RVERSION);
+        out_string(c, "VERSION " VERSION);
 
     } else if (ntokens == 2 && (strcmp(tokens[COMMAND_TOKEN].value, "quit") == 0)) {
 
@@ -3400,18 +3362,9 @@ static void process_command(conn *c, char *command) {
             case REASSIGN_NOSPARE:
                 out_string(c, "NOSPARE source class has no spare pages");
                 break;
-            case REASSIGN_DEST_NOT_FULL:
-                out_string(c, "NOTFULL dest class has spare memory");
-                break;
-            case REASSIGN_SRC_NOT_SAFE:
-                out_string(c, "UNSAFE src class is in an unsafe state");
-                break;
             case REASSIGN_SRC_DST_SAME:
                 out_string(c, "SAME src and dst class are identical");
                 break;
-            default:
-                assert(false);
-                abort();
             }
             return;
         } else if (ntokens == 4 &&
@@ -3866,9 +3819,6 @@ static void drive_machine(conn *c) {
             case READ_MEMORY_ERROR: /* Failed to allocate more memory */
                 /* State already set by try_read_network */
                 break;
-            default:
-                assert(false);
-                abort();
             }
             break;
 
@@ -4078,9 +4028,6 @@ static void drive_machine(conn *c) {
             case TRANSMIT_SOFT_ERROR:
                 stop = true;
                 break;
-            default:
-                assert(false);
-                abort();
             }
             break;
 
@@ -4095,9 +4042,6 @@ static void drive_machine(conn *c) {
         case conn_max_state:
             assert(false);
             break;
-        default:
-            assert(false);
-            abort();
         }
     }
 
@@ -4242,12 +4186,7 @@ static int server_socket(const char *interface,
         }
 #endif
 
-        error = setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
-        if (error != 0)
-        {
-          perror("setsockopt(SO_REUSEADDR)");
-        }
-
+        setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (void *)&flags, sizeof(flags));
         if (IS_UDP(transport)) {
             maximize_sndbuf(sfd);
         } else {
@@ -4504,7 +4443,7 @@ static void clock_handler(const int fd, const short which, void *arg) {
 }
 
 static void usage(void) {
-    printf(RPACKAGE " " RVERSION "\n");
+    printf(PACKAGE " " VERSION "\n");
     printf("-p <num>      TCP port number to listen on (default: 11211)\n"
            "-U <num>      UDP port number to listen on (default: 11211, 0 is off)\n"
            "-s <file>     UNIX socket path to listen on (disables network support)\n"
@@ -4569,7 +4508,7 @@ static void usage(void) {
 }
 
 static void usage_license(void) {
-    printf(RPACKAGE " " RVERSION "\n\n");
+    printf(PACKAGE " " VERSION "\n\n");
     printf(
     "Copyright (c) 2003, Danga Interactive, Inc. <http://www.danga.com/>\n"
     "All rights reserved.\n"
@@ -4731,7 +4670,7 @@ static int enable_large_pages(void) {
 
     return ret;
 #else
-    return 0;
+    return -1;
 #endif
 }
 
@@ -4788,10 +4727,10 @@ int main (int argc, char **argv) {
         SLAB_AUTOMOVE
     };
     char *const subopts_tokens[] = {
-        [MAXCONNS_FAST] = (char*)"maxconns_fast",
-        [HASHPOWER_INIT] = (char*)"hashpower",
-        [SLAB_REASSIGN] = (char*)"slab_reassign",
-        [SLAB_AUTOMOVE] = (char*)"slab_automove",
+        [MAXCONNS_FAST] = "maxconns_fast",
+        [HASHPOWER_INIT] = "hashpower",
+        [SLAB_REASSIGN] = "slab_reassign",
+        [SLAB_AUTOMOVE] = "slab_automove",
         NULL
     };
 
@@ -4952,6 +4891,10 @@ int main (int argc, char **argv) {
         case 'L' :
             if (enable_large_pages() == 0) {
                 preallocate = true;
+            } else {
+                fprintf(stderr, "Cannot enable large pages on this system\n"
+                    "(There is no Linux support as of this version)\n");
+                return 1;
             }
             break;
         case 'C' :
@@ -5041,7 +4984,15 @@ int main (int argc, char **argv) {
                 settings.slab_reassign = true;
                 break;
             case SLAB_AUTOMOVE:
-                settings.slab_automove = true;
+                if (subopts_value == NULL) {
+                    settings.slab_automove = 1;
+                    break;
+                }
+                settings.slab_automove = atoi(subopts_value);
+                if (settings.slab_automove < 0 || settings.slab_automove > 2) {
+                    fprintf(stderr, "slab_automove must be between 0 and 2\n");
+                    return 1;
+                }
                 break;
             default:
                 printf("Illegal suboption \"%s\"\n", subopts_value);
@@ -5283,10 +5234,8 @@ int main (int argc, char **argv) {
     stop_assoc_maintenance_thread();
 
     /* remove the PID file if we're a daemon */
-#if 0
     if (do_daemonize)
         remove_pidfile(pid_file);
-#endif
     /* Clean up strdup() call for bind() address */
     if (settings.inter)
       free(settings.inter);
index d070502c023c70c8d99e8b44032afe715c84659f..edd7fcf8cfefbbc42dbcb732785a0778524f18f6 100644 (file)
@@ -10,7 +10,6 @@
 #endif
 
 #include <stdbool.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>
@@ -74,7 +73,6 @@
 #define POWER_SMALLEST 1
 #define POWER_LARGEST  200
 #define CHUNK_ALIGN_BYTES 8
-#define DONT_PREALLOC_SLABS
 #define MAX_NUMBER_OF_SLAB_CLASSES (POWER_LARGEST + 1)
 
 /** How long an object can reasonably be assumed to be locked before
@@ -303,13 +301,10 @@ struct settings {
     bool sasl;              /* SASL on/off */
     bool maxconns_fast;     /* Whether or not to early close connections */
     bool slab_reassign;     /* Whether or not slab reassignment is allowed */
-    bool slab_automove;     /* Whether or not to automatically move slabs */
+    int slab_automove;     /* Whether or not to automatically move slabs */
     int hashpower_init;     /* Starting hash power level */
 };
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wshadow"
-#endif
 extern struct stats stats;
 extern time_t process_started;
 extern struct settings settings;
@@ -322,9 +317,6 @@ extern struct settings settings;
 
 #define ITEM_FETCHED 8
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wshadow"
-#endif
 /**
  * Structure for storing items within memcached.
  */
@@ -556,7 +548,7 @@ void append_stat(const char *name, ADD_STAT add_stats, conn *c,
 
 enum store_item_type store_item(item *item, int comm, conn *c);
 
-#if defined(HAVE_DROP_PRIVILEGES) && HAVE_DROP_PRIVILEGES
+#if HAVE_DROP_PRIVILEGES
 extern void drop_privileges(void);
 #else
 #define drop_privileges()
index f473d8fa3ad01ff3d3646205fba492070c75024f..678be90a633767645bffbef618688c3f0055df88 100644 (file)
@@ -83,7 +83,7 @@ exit 0
 
 %files
 %defattr(-,root,root,-)
-%doc AUTHORS ChangeLog COPYING NEWS README doc/CONTRIBUTORS doc/*.txt
+%doc AUTHORS ChangeLog COPYING NEWS README.md doc/CONTRIBUTORS doc/*.txt
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 
 %dir %attr(750,nobody,nobody) %{_localstatedir}/run/memcached
index eeffb6f3e67bc9ba8e1a99e044333c1cf31d9ab1..0fe132c442933393504b242bb64bb82322b5e77e 100644 (file)
@@ -250,6 +250,17 @@ provider memcached {
     */
    probe command__append(int connid, const char *key, int keylen, int size, int64_t casid);
 
+   /**
+    * Fired for an touch-command.
+    * @param connid connection id
+    * @param key requested key
+    * @param keylen length of the key
+    * @param size the new size of the key's data (or signed int -1 if
+    *             not found)
+    * @param casid the casid for the item
+    */
+   probe command__touch(int connid, const char *key, int keylen, int size, int64_t casid);
+
    /**
     * Fired for a cas-command.
     * @param connid connection id
index 7cffe43474927aa1bfb953e23611455214fac6d0..b74617e25de9ebc2c814e0515c8a63bb0315d358 100644 (file)
@@ -30,9 +30,6 @@ typedef struct {
     void *slots;           /* list of item ptrs */
     unsigned int sl_curr;   /* total free items in list */
 
-    void *end_page_ptr;         /* pointer to next free item at end of page, or 0 */
-    unsigned int end_page_free; /* number of items remaining at end of last alloced page */
-
     unsigned int slabs;     /* how many slabs were allocated for this class */
 
     void **slab_list;       /* array of slab pointers */
@@ -55,14 +52,15 @@ static size_t mem_avail = 0;
  * Access to the slab allocator is protected by this lock
  */
 static pthread_mutex_t slabs_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t slabs_rebalance_lock = PTHREAD_MUTEX_INITIALIZER;
 
 /*
  * Forward Declarations
  */
 static int do_slabs_newslab(const unsigned int id);
 static void *memory_allocate(size_t size);
+static void do_slabs_free(void *ptr, const size_t size, unsigned int id);
 
-#ifndef DONT_PREALLOC_SLABS
 /* Preallocate as many slab pages as possible (called from slabs_init)
    on start-up, so users don't get confused out-of-memory errors when
    they do have free (in-slab) space, but no space to make new slabs.
@@ -70,7 +68,6 @@ static void *memory_allocate(size_t size);
    slab types can be made.  if max memory is less than 18 MB, only the
    smaller ones will be made.  */
 static void slabs_preallocate (const unsigned int maxslabs);
-#endif
 
 /*
  * Figures out which slab class (chunk size) is required to store an item of
@@ -146,18 +143,11 @@ void slabs_init(const size_t limit, const double factor, const bool prealloc) {
 
     }
 
-#ifndef DONT_PREALLOC_SLABS
-    {
-        char *pre_alloc = getenv("T_MEMD_SLABS_ALLOC");
-
-        if (pre_alloc == NULL || atoi(pre_alloc) != 0) {
-            slabs_preallocate(power_largest);
-        }
+    if (prealloc) {
+        slabs_preallocate(power_largest);
     }
-#endif
 }
 
-#ifndef DONT_PREALLOC_SLABS
 static void slabs_preallocate (const unsigned int maxslabs) {
     int i;
     unsigned int prealloc = 0;
@@ -171,11 +161,15 @@ static void slabs_preallocate (const unsigned int maxslabs) {
     for (i = POWER_SMALLEST; i <= POWER_LARGEST; i++) {
         if (++prealloc > maxslabs)
             return;
-        do_slabs_newslab(i);
+        if (do_slabs_newslab(i) == 0) {
+            fprintf(stderr, "Error while preallocating slab memory!\n"
+                "If using -L or other prealloc options, max memory must be "
+                "at least %d megabytes.\n", power_largest);
+            exit(1);
+        }
     }
 
 }
-#endif
 
 static int grow_slab_list (const unsigned int id) {
     slabclass_t *p = &slabclass[id];
@@ -189,9 +183,14 @@ static int grow_slab_list (const unsigned int id) {
     return 1;
 }
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wsign-compare"
-#endif
+static void split_slab_page_into_freelist(char *ptr, const unsigned int id) {
+    slabclass_t *p = &slabclass[id];
+    int x;
+    for (x = 0; x < p->perslab; x++) {
+        do_slabs_free(ptr, 0, id);
+        ptr += p->size;
+    }
+}
 
 static int do_slabs_newslab(const unsigned int id) {
     slabclass_t *p = &slabclass[id];
@@ -208,8 +207,7 @@ static int do_slabs_newslab(const unsigned int id) {
     }
 
     memset(ptr, 0, (size_t)len);
-    p->end_page_ptr = ptr;
-    p->end_page_free = p->perslab;
+    split_slab_page_into_freelist(ptr, id);
 
     p->slab_list[p->slabs++] = ptr;
     mem_malloced += len;
@@ -232,21 +230,9 @@ static void *do_slabs_alloc(const size_t size, unsigned int id) {
     p = &slabclass[id];
     assert(p->sl_curr == 0 || ((item *)p->slots)->slabs_clsid == 0);
 
-#ifdef USE_SYSTEM_MALLOC
-    if (mem_limit && mem_malloced + size > mem_limit) {
-        MEMCACHED_SLABS_ALLOCATE_FAILED(size, id);
-        return 0;
-    }
-    mem_malloced += size;
-    ret = malloc(size);
-    MEMCACHED_SLABS_ALLOCATE(size, id, 0, ret);
-    return ret;
-#endif
-
     /* fail unless we have space at the end of a recently allocated page,
        we have something on our freelist, or we could allocate a new page */
-    if (! (p->end_page_ptr != 0 || p->sl_curr != 0 ||
-           do_slabs_newslab(id) != 0)) {
+    if (! (p->sl_curr != 0 || do_slabs_newslab(id) != 0)) {
         /* We don't have more memory available */
         ret = NULL;
     } else if (p->sl_curr != 0) {
@@ -256,15 +242,6 @@ static void *do_slabs_alloc(const size_t size, unsigned int id) {
         if (it->next) it->next->prev = 0;
         p->sl_curr--;
         ret = (void *)it;
-    } else {
-        /* if we recently allocated a whole page, return from that */
-        assert(p->end_page_ptr != NULL);
-        ret = p->end_page_ptr;
-        if (--p->end_page_free != 0) {
-            p->end_page_ptr = ((caddr_t)p->end_page_ptr) + p->size;
-        } else {
-            p->end_page_ptr = 0;
-        }
     }
 
     if (ret) {
@@ -289,12 +266,6 @@ static void do_slabs_free(void *ptr, const size_t size, unsigned int id) {
     MEMCACHED_SLABS_FREE(size, id, ptr);
     p = &slabclass[id];
 
-#ifdef USE_SYSTEM_MALLOC
-    mem_malloced -= size;
-    free(ptr);
-    return;
-#endif
-
     it = (item *)ptr;
     it->it_flags |= ITEM_SLABBED;
     it->prev = 0;
@@ -367,9 +338,10 @@ static void do_slabs_stats(ADD_STAT add_stats, void *c) {
             APPEND_NUM_STAT(i, "total_pages", "%u", slabs);
             APPEND_NUM_STAT(i, "total_chunks", "%u", slabs * perslab);
             APPEND_NUM_STAT(i, "used_chunks", "%u",
-                            slabs*perslab - p->sl_curr - p->end_page_free);
+                            slabs*perslab - p->sl_curr);
             APPEND_NUM_STAT(i, "free_chunks", "%u", p->sl_curr);
-            APPEND_NUM_STAT(i, "free_chunks_end", "%u", p->end_page_free);
+            /* Stat is dead, but displaying zero instead of removing it. */
+            APPEND_NUM_STAT(i, "free_chunks_end", "%u", 0);
             APPEND_NUM_STAT(i, "mem_requested", "%llu",
                             (unsigned long long)p->requested);
             APPEND_NUM_STAT(i, "get_hits", "%llu",
@@ -464,14 +436,15 @@ void slabs_adjust_mem_requested(unsigned int id, size_t old, size_t ntotal)
 }
 
 static pthread_cond_t maintenance_cond = PTHREAD_COND_INITIALIZER;
+static pthread_cond_t slab_rebalance_cond = PTHREAD_COND_INITIALIZER;
 static volatile int do_run_slab_thread = 1;
+static volatile int do_run_slab_rebalance_thread = 1;
 
 #define DEFAULT_SLAB_BULK_CHECK 1
 int slab_bulk_check = DEFAULT_SLAB_BULK_CHECK;
 
 static int slab_rebalance_start(void) {
     slabclass_t *s_cls;
-    slabclass_t *d_cls;
     int no_go = 0;
 
     pthread_mutex_lock(&cache_lock);
@@ -485,10 +458,8 @@ static int slab_rebalance_start(void) {
         no_go = -2;
 
     s_cls = &slabclass[slab_rebal.s_clsid];
-    d_cls = &slabclass[slab_rebal.d_clsid];
 
-    if (d_cls->end_page_ptr || s_cls->end_page_ptr ||
-        !grow_slab_list(slab_rebal.d_clsid)) {
+    if (!grow_slab_list(slab_rebal.d_clsid)) {
         no_go = -1;
     }
 
@@ -597,9 +568,6 @@ static int slab_rebalance_move(void) {
                 break;
             case MOVE_PASS:
                 break;
-            default:
-                assert(false);
-                abort();
         }
 
         slab_rebal.slab_pos = (char *)slab_rebal.slab_pos + s_cls->size;
@@ -642,8 +610,8 @@ static void slab_rebalance_finish(void) {
     memset(slab_rebal.slab_start, 0, (size_t)settings.item_size_max);
 
     d_cls->slab_list[d_cls->slabs++] = slab_rebal.slab_start;
-    d_cls->end_page_ptr = slab_rebal.slab_start;
-    d_cls->end_page_free = d_cls->perslab;
+    split_slab_page_into_freelist(slab_rebal.slab_start,
+        slab_rebal.d_clsid);
 
     slab_rebal.done       = 0;
     slab_rebal.s_clsid    = 0;
@@ -735,43 +703,83 @@ static int slab_automove_decision(int *src, int *dst) {
     return 0;
 }
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-#endif
 /* Slab rebalancer thread.
  * Does not use spinlocks since it is not timing sensitive. Burn less CPU and
  * go to sleep if locks are contended
  */
 static void *slab_maintenance_thread(void *arg) {
-    int was_busy = 0;
     int src, dest;
 
     while (do_run_slab_thread) {
+        if (settings.slab_automove == 1) {
+            if (slab_automove_decision(&src, &dest) == 1) {
+                /* Blind to the return codes. It will retry on its own */
+                slabs_reassign(src, dest);
+            }
+            sleep(1);
+        } else {
+            /* Don't wake as often if we're not enabled.
+             * This is lazier than setting up a condition right now. */
+            sleep(5);
+        }
+    }
+    return NULL;
+}
+
+/* Slab mover thread.
+ * Sits waiting for a condition to jump off and shovel some memory about
+ */
+static void *slab_rebalance_thread(void *arg) {
+    int was_busy = 0;
+
+    while (do_run_slab_rebalance_thread) {
         if (slab_rebalance_signal == 1) {
             if (slab_rebalance_start() < 0) {
                 /* Handle errors with more specifity as required. */
                 slab_rebalance_signal = 0;
             }
 
+            was_busy = 0;
         } else if (slab_rebalance_signal && slab_rebal.slab_start != NULL) {
-            /* If we have a decision to continue, continue it */
             was_busy = slab_rebalance_move();
-        } else if (settings.slab_automove && slab_automove_decision(&src, &dest) == 1) {
-            /* Blind to the return codes. It will retry on its own */
-            slabs_reassign(src, dest);
         }
 
         if (slab_rebal.done) {
             slab_rebalance_finish();
+        } else if (was_busy) {
+            /* Stuck waiting for some items to unlock, so slow down a bit
+             * to give them a chance to free up */
+            usleep(50);
         }
 
-        /* Sleep a bit if no work to do, or waiting on busy objects */
-        if (was_busy || !slab_rebalance_signal)
-            sleep(1);
+        if (slab_rebalance_signal == 0) {
+            /* always hold this lock while we're running */
+            pthread_cond_wait(&slab_rebalance_cond, &slabs_rebalance_lock);
+        }
     }
     return NULL;
 }
 
+/* Iterate at most once through the slab classes and pick a "random" source.
+ * I like this better than calling rand() since rand() is slow enough that we
+ * can just check all of the classes once instead.
+ */
+static int slabs_reassign_pick_any(int dst) {
+    static int cur = POWER_SMALLEST - 1;
+    int tries = power_largest - POWER_SMALLEST + 1;
+    for (; tries > 0; tries--) {
+        cur++;
+        if (cur > power_largest)
+            cur = POWER_SMALLEST;
+        if (cur == dst)
+            continue;
+        if (slabclass[cur].slabs > 1) {
+            return cur;
+        }
+    }
+    return -1;
+}
+
 static enum reassign_result_type do_slabs_reassign(int src, int dst) {
     if (slab_rebalance_signal != 0)
         return REASSIGN_RUNNING;
@@ -779,6 +787,12 @@ static enum reassign_result_type do_slabs_reassign(int src, int dst) {
     if (src == dst)
         return REASSIGN_SRC_DST_SAME;
 
+    /* Special indicator to choose ourselves. */
+    if (src == -1) {
+        src = slabs_reassign_pick_any(dst);
+        /* TODO: If we end up back at -1, return a new error type */
+    }
+
     if (src < POWER_SMALLEST || src > power_largest ||
         dst < POWER_SMALLEST || dst > power_largest)
         return REASSIGN_BADCLASS;
@@ -786,29 +800,27 @@ static enum reassign_result_type do_slabs_reassign(int src, int dst) {
     if (slabclass[src].slabs < 2)
         return REASSIGN_NOSPARE;
 
-    if (slabclass[dst].end_page_ptr)
-        return REASSIGN_DEST_NOT_FULL;
-
-    if (slabclass[src].end_page_ptr)
-        return REASSIGN_SRC_NOT_SAFE;
-
     slab_rebal.s_clsid = src;
     slab_rebal.d_clsid = dst;
 
     slab_rebalance_signal = 1;
+    pthread_cond_signal(&slab_rebalance_cond);
 
     return REASSIGN_OK;
 }
 
 enum reassign_result_type slabs_reassign(int src, int dst) {
     enum reassign_result_type ret;
-    mutex_lock(&slabs_lock);
+    if (pthread_mutex_trylock(&slabs_rebalance_lock) != 0) {
+        return REASSIGN_RUNNING;
+    }
     ret = do_slabs_reassign(src, dst);
-    pthread_mutex_unlock(&slabs_lock);
+    pthread_mutex_unlock(&slabs_rebalance_lock);
     return ret;
 }
 
 static pthread_t maintenance_tid;
+static pthread_t rebalance_tid;
 
 int start_slab_maintenance_thread(void) {
     int ret;
@@ -821,9 +833,21 @@ int start_slab_maintenance_thread(void) {
             slab_bulk_check = DEFAULT_SLAB_BULK_CHECK;
         }
     }
+
+    if (pthread_cond_init(&slab_rebalance_cond, NULL) != 0) {
+        fprintf(stderr, "Can't intiialize rebalance condition\n");
+        return -1;
+    }
+    pthread_mutex_init(&slabs_rebalance_lock, NULL);
+
     if ((ret = pthread_create(&maintenance_tid, NULL,
                               slab_maintenance_thread, NULL)) != 0) {
-        fprintf(stderr, "Can't create thread: %s\n", strerror(ret));
+        fprintf(stderr, "Can't create slab maint thread: %s\n", strerror(ret));
+        return -1;
+    }
+    if ((ret = pthread_create(&rebalance_tid, NULL,
+                              slab_rebalance_thread, NULL)) != 0) {
+        fprintf(stderr, "Can't create rebal thread: %s\n", strerror(ret));
         return -1;
     }
     return 0;
@@ -832,9 +856,11 @@ int start_slab_maintenance_thread(void) {
 void stop_slab_maintenance_thread(void) {
     mutex_lock(&cache_lock);
     do_run_slab_thread = 0;
+    do_run_slab_rebalance_thread = 0;
     pthread_cond_signal(&maintenance_cond);
     pthread_mutex_unlock(&cache_lock);
 
     /* Wait for the maintenance thread to stop */
     pthread_join(maintenance_tid, NULL);
+    pthread_join(rebalance_tid, NULL);
 }
index 90e2bd820fd601876887dfd35df08571597c7289..7c6140b2b40458fe58d83b84ad70007f0589385d 100644 (file)
@@ -16,9 +16,6 @@ void slabs_init(const size_t limit, const double factor, const bool prealloc);
  * 0 means error: can't store such a large object
  */
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wshadow"
-#endif
 unsigned int slabs_clsid(const size_t size);
 
 /** Allocate object of given length. 0 on error */ /*@null@*/
@@ -41,7 +38,7 @@ void stop_slab_maintenance_thread(void);
 
 enum reassign_result_type {
     REASSIGN_OK=0, REASSIGN_RUNNING, REASSIGN_BADCLASS, REASSIGN_NOSPARE,
-    REASSIGN_DEST_NOT_FULL, REASSIGN_SRC_NOT_SAFE, REASSIGN_SRC_DST_SAME
+    REASSIGN_SRC_DST_SAME
 };
 
 enum reassign_result_type slabs_reassign(int src, int dst);
index 504ddef1d7b6076801b4a15cc22ba46d433cc0fe..3eb8e0b243139e3c59bcf6e5126c89ab0db3392f 100755 (executable)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 3539;
+use Test::More tests => 3549;
 use FindBin qw($Bin);
 use lib "$Bin/lib";
 use MemcachedTest;
@@ -273,6 +273,10 @@ is($mc->decr("x", 211), 0, "Floor is zero");
     $check->("totouch", 0, "toast2");
 
     # Test miss as well
+    $mc->set("totouch", "toast3", 0, 1);
+    $res = $mc->touch("totouch", 1);
+    sleep 3;
+    $empty->("totouch");
 }
 
 # diag "Silent set.";
index cf4b6f8d927a76fceafb6d8261bee2e21b38b65e..ae5ddce31232350d9df14cc3beed9d8ce6105df8 100644 (file)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 131;
+use Test::More tests => 130;
 use FindBin qw($Bin);
 use lib "$Bin/lib";
 use MemcachedTest;
@@ -52,14 +52,16 @@ ok($slabs_before->{"31:total_pages"} != $slabs_after->{"31:total_pages"},
 ok($slabs_before->{"25:total_pages"} != $slabs_after->{"25:total_pages"},
     "slab 25 pagecount changed");
 
-# Try to move another slab, see that it complains
+# Try to move another slab, see that you can move two in a row
 print $sock "slabs reassign 31 25\r\n";
-like(scalar <$sock>, qr/^NOTFULL/, "Cannot re-run against class with empty space");
+like(scalar <$sock>, qr/^OK/, "Cannot re-run against class with empty space");
 
 # Try to move a page backwards. Should complain that source class isn't "safe"
 # to move from.
-print $sock "slabs reassign 25 31\r\n";
-like(scalar <$sock>, qr/^UNSAFE/, "Cannot move an unsafe slab back");
+# TODO: Wait until the above command completes, then try to move it back?
+# Seems pointless...
+#print $sock "slabs reassign 25 31\r\n";
+#like(scalar <$sock>, qr/^UNSAFE/, "Cannot move an unsafe slab back");
 
 # Try to insert items into both slabs
 print $sock "set bfoo51 0 0 70000\r\n", $bigdata, "\r\n";
index 22c610cbda2563d813b9258db1dfa61ce730491e..7d5d91691341f64ccfd38da9df77df4e165f53c5 100755 (executable)
@@ -6,10 +6,11 @@ our @files;
 BEGIN {
     chdir "$Bin/.." or die;
 
-    my @exempted = qw(Makefile.am ChangeLog doc/Makefile.am);
+    my @exempted = qw(Makefile.am ChangeLog doc/Makefile.am README README.md);
     push(@exempted, glob("doc/*.xml"));
     push(@exempted, glob("doc/xml2rfc/*.xsl"));
     push(@exempted, glob("m4/*backport*m4"));
+    push(@exempted, glob("*.orig"));
     my %exempted_hash = map { $_ => 1 } @exempted;
 
     my @stuff = split /\0/, `git ls-files -z -c -m -o --exclude-standard`;
@@ -29,7 +30,7 @@ BEGIN {
 use Test::More tests => scalar(@files);
 
 foreach my $f (@files) {
-    open(my $fh, $f) or die;
+    open(my $fh, $f) or die "Cannot open file $f: $!";
     my $before = do { local $/; <$fh>; };
     close ($fh);
     my $after = $before;
index aba0b90519b78d9726be67ebaf1a1083ecae4bb8..9faccf4e11cc2fe0e59600a31d82cb490ce2481a 100644 (file)
@@ -382,8 +382,8 @@ static pid_t start_server(in_port_t *port_out, bool daemon, int timeout) {
     if (daemon) {
         /* loop and wait for the pid file.. There is a potential race
          * condition that the server just created the file but isn't
-         * finished writing the content, but I'll take the chance....
-         */
+         * finished writing the content, so we loop a few times
+         * reading as well */
         while (access(pid_file, F_OK) == -1) {
             usleep(10);
         }
@@ -394,7 +394,11 @@ static pid_t start_server(in_port_t *port_out, bool daemon, int timeout) {
                     strerror(errno));
             assert(false);
         }
-        assert(fgets(buffer, sizeof(buffer), fp) != NULL);
+
+        /* Avoid race by retrying 20 times */
+        for (int x = 0; x < 20 && fgets(buffer, sizeof(buffer), fp) == NULL; x++) {
+            usleep(10);
+        }
         fclose(fp);
 
         int32_t val;
index e362249733d47674f39b683898a85da0c880bf38..f4bbe1e78d4e5ed8ff90ca80933239adc7e9fbc6 100644 (file)
@@ -88,7 +88,7 @@ unsigned short refcount_incr(unsigned short *refcount) {
     mutex_lock(&atomics_mutex);
     (*refcount)++;
     res = *refcount;
-    pthread_mutex_unlock(&atomics_mutex);
+    mutex_unlock(&atomics_mutex);
     return res;
 #endif
 }
@@ -103,7 +103,7 @@ unsigned short refcount_decr(unsigned short *refcount) {
     mutex_lock(&atomics_mutex);
     (*refcount)--;
     res = *refcount;
-    pthread_mutex_unlock(&atomics_mutex);
+    mutex_unlock(&atomics_mutex);
     return res;
 #endif
 }
@@ -113,7 +113,7 @@ void item_lock(uint32_t hv) {
 }
 
 void item_unlock(uint32_t hv) {
-    pthread_mutex_unlock(&item_locks[hv & item_lock_mask]);
+    mutex_unlock(&item_locks[hv & item_lock_mask]);
 }
 
 /*
@@ -299,9 +299,6 @@ static void *worker_libevent(void *arg) {
 }
 
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-#endif
 /*
  * Processes an incoming "handle a new connection" item. This is called when
  * input arrives on the libevent wakeup pipe.
@@ -508,7 +505,7 @@ enum store_item_type store_item(item *item, int comm, conn* c) {
 void item_flush_expired() {
     mutex_lock(&cache_lock);
     do_item_flush_expired();
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
 }
 
 /*
@@ -519,7 +516,7 @@ char *item_cachedump(unsigned int slabs_clsid, unsigned int limit, unsigned int
 
     mutex_lock(&cache_lock);
     ret = do_item_cachedump(slabs_clsid, limit, bytes);
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
     return ret;
 }
 
@@ -529,7 +526,7 @@ char *item_cachedump(unsigned int slabs_clsid, unsigned int limit, unsigned int
 void  item_stats(ADD_STAT add_stats, void *c) {
     mutex_lock(&cache_lock);
     do_item_stats(add_stats, c);
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
 }
 
 /*
@@ -538,7 +535,7 @@ void  item_stats(ADD_STAT add_stats, void *c) {
 void  item_stats_sizes(ADD_STAT add_stats, void *c) {
     mutex_lock(&cache_lock);
     do_item_stats_sizes(add_stats, c);
-    pthread_mutex_unlock(&cache_lock);
+    mutex_unlock(&cache_lock);
 }
 
 /******************************* GLOBAL STATS ******************************/
@@ -658,9 +655,6 @@ void slab_stats_aggregate(struct thread_stats *stats, struct slab_stats *out) {
     }
 }
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wsign-compare"
-#endif
 /*
  * Initializes the thread subsystem, creating various worker threads.
  *
index d92e6212b8846d38d6401b73dd34b1b241c9a6b3..ee1605c52900e915aaafdb5c0649eca3fa19c166 100644 (file)
@@ -1,4 +1,4 @@
-#include "memcached.h"
+#include <config.h>
 
 #include <stdio.h>
 #include <assert.h>
@@ -8,6 +8,8 @@
 #include <stdlib.h>
 #include <stdarg.h>
 
+#include "memcached.h"
+
 /* Avoid warnings on solaris, where isspace() is an index into an array, and gcc uses signed chars */
 #define xisspace(c) isspace((unsigned char)c)
 
diff --git a/memcached/version.m4 b/memcached/version.m4
deleted file mode 100644 (file)
index 5914292..0000000
+++ /dev/null
@@ -1 +0,0 @@
-m4_define([VERSION_NUMBER], [1.4.13])
index b0aee33ae93cdafb259d959b6842579302415cd5..7500fcbf3578c5718b0c0910c1fcdb2f00290c3d 100644 (file)
@@ -82,7 +82,7 @@ you will need to install %{name}-devel.
 
 %build
 %configure
-%{__make}
+%{__make} %{?_smp_mflags}
 
 
 %install
index 679473eadd02c823b19dbc98502e5dcddfddee0a..32df0da0883e74ec4813035f3dc758d1b06b3923 100644 (file)
@@ -127,7 +127,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
   return &servers;
 }
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index 95c8fb6ad8cfb8f482414a8b8d6afeb682547427..b03a0433d71d3b756ebf4460250d4183369b06db 100644 (file)
@@ -59,10 +59,12 @@ using namespace std;
 using namespace memcache;
 using namespace libtest;
 
-Framework *global_framework= NULL;
+libtest::Framework *global_framework= NULL;
 
 static test_return_t shutdown_servers(memcached_st *memc)
 {
+  return TEST_SKIPPED;
+
   test_skip_valgrind();
 
   test_compare(memcached_server_count(memc), 1U);
@@ -75,6 +77,8 @@ static test_return_t shutdown_servers(memcached_st *memc)
 
 static test_return_t add_shutdown_servers(memcached_st *memc)
 {
+  return TEST_SKIPPED;
+
   test_skip_valgrind();
 
   while (memcached_server_count(memc) < 2)
@@ -220,7 +224,7 @@ collection_st collection[] ={
 
 #include "tests/libmemcached_world.h"
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->servers().set_servers_to_run(1);
 
index 19c77c3822e11f92281a918f60df6273d2d495e0..257a42ec643f2170c07248465b70281e088ffb81 100644 (file)
@@ -213,7 +213,7 @@ collection_st collection[] ={
   {0, 0, 0, 0}
 };
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
 }
index 4934b55b45c018aba451b8a37058624172ee0fd0..b45be3ae86856764f62ab57dda8aa23be753f5e6 100644 (file)
@@ -562,7 +562,7 @@ static bool world_destroy(void *object)
   return TEST_SUCCESS;
 }
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index 8aeac4d9694b5cfa7af03744d2a86c291f2daf3b..aaa89c0a407e816dc7a4df8907ef7f146415a940 100644 (file)
@@ -71,7 +71,7 @@
 
 #include <algorithm>
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   if (getenv("LIBMEMCACHED_SERVER_NUMBER"))
   {
index 958873fb9f3fd7cd4e78e9de6bd6d019904376f4..47ab67eb407085935c437baeb5ef72f36c5b80dd 100644 (file)
@@ -69,7 +69,7 @@
 
 #include "tests/libmemcached_world_socket.h"
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
 
index e5d53b60ea76079026aa300385d3ecac8471e658..aad0961b6be99211394239101f95a4093c6ccbab 100644 (file)
@@ -273,7 +273,7 @@ collection_st collection[] ={
 
 #include "tests/libmemcached_world.h"
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
 
index 6e0232fc3a3d0eb72fdb439e34fb6b466cf848b1..89d51413a33babfe67b66d88e3460635d997c47a 100644 (file)
@@ -61,7 +61,7 @@ collection_st collection[] ={
   {0, 0, 0, 0}
 };
 
-void get_world(Framework *frame)
+void get_world(libtest::Framework* frame)
 {
   frame->collections(collection);
 }
index 07603cb4219c4f60bacf8b29c3c0431eb6994bd8..3b1701e8315da782714a59810861b44c7720f3b2 100644 (file)
@@ -4480,6 +4480,7 @@ test_return_t regression_1021819_TEST(memcached_st *original)
   test_true(memc);
 
   test_compare(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SND_TIMEOUT, 2000000), MEMCACHED_SUCCESS);
+  test_compare(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_RCV_TIMEOUT, 3000000), MEMCACHED_SUCCESS);
 
   memcached_return_t rc;
 
index 68f1d7e01800893d010637a04ec9d922ef40bf78..e7bfd836892f35139bc6e43fce21deacdb8cfba3 100644 (file)
@@ -322,7 +322,7 @@ collection_st collection[] ={
 #define TEST_PORT_BASE MEMCACHED_DEFAULT_PORT +10
 #include "tests/libmemcached_world.h"
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
 
index 0ae101f2925f4855b574dad9c04386a5e1c18895..6dae42378177a941b55260a886495a65d00415ec 100644 (file)
@@ -99,7 +99,7 @@ collection_st collection[] ={
 
 #include "tests/libmemcached_world.h"
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
 
index 8bc48a71755102d9747a3d3ab22d186c64ffdb7b..5147e1a42a4e0c44acbfc53673b5bcfa8f083d90 100644 (file)
@@ -70,14 +70,22 @@ static void *world_create(libtest::server_startup_st& servers, test_return_t& er
     {
       if (server_startup(servers, "memcached-sasl", port, 0, NULL) == false)
       {
+        error= TEST_SKIPPED;
+#if 0
         fatal_message("Could not start memcached-sasl");
+#endif
+        return NULL;
       }
     }
     else
     {
       if (server_startup(servers, "memcached", port, 0, NULL) == false)
       {
+        error= TEST_SKIPPED;
+#if 0
         fatal_message("Could not start memcached");
+#endif
+        return NULL;
       }
     }
   }
index fbfb5a9cd14a2353135646fbc9bea47f8a649316..a3078e7670d347bd2d2d993536ff569c31934052 100644 (file)
@@ -56,7 +56,11 @@ static void *world_create(libtest::server_startup_st& servers, test_return_t& er
     const char *argv[1]= { "memcached" };
     if (servers.start_socket_server("memcached", libtest::get_free_port(), 1, argv) == false)
     {
+#if 0
       fatal_message("Could not launch memcached");
+#endif
+      error= TEST_SKIPPED;
+      return NULL;
     }
   }
 
index 42dbcb69638fcb4b96a08434a52f4a8071d6654c..ed657bf4a5fd111cd6946cf81ef6bb7d6f7343d1 100644 (file)
@@ -566,7 +566,7 @@ collection_st collection[] ={
 
 #include "tests/libmemcached_world.h"
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
 
index 2723e7f656783bd52dca18b4ef6d02eaf09edfa3..93ad1860bdc986bce7aee4e170ba6a5c1ebf3388 100644 (file)
@@ -115,14 +115,14 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 
   if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
   {
-    error= TEST_FAILURE;
+    error= TEST_SKIPPED;
   }
 
   return &servers;
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   executable= "./clients/memcapable";
   world->collections(collection);
index f70da3be2fab0cabeb26a4f2c60fcc846ad37d69..d86213c03a43b6ee2af9e0cc778493f372f22481 100644 (file)
@@ -141,7 +141,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index 590f1af3b563a442a2e99aa478667e8c57fbf51d..04c47f80956a014ccfa640c46fc87dd9f356a557 100644 (file)
@@ -100,7 +100,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index ac1619c317fbbb1372bb49ecc4e7a3f6dc85e0b4..6f9330a536e0d46a2fbd6953eb424ee7ec90e59a 100644 (file)
@@ -127,7 +127,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index 1c893e11b5851b4244cba2412801c4282baf57ac..76cc96c434570134387a79d112b478a2b8164064 100644 (file)
@@ -123,7 +123,7 @@ static void *world_create(server_startup_st&, test_return_t& error)
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index a9430a33c2dfe901058c3ccbd8d28d7e02def797..e3a57c5c5970d48bf99118dbb0d9e05138075d12 100644 (file)
@@ -151,14 +151,14 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 
   if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
   {
-    error= TEST_FAILURE;
+    error= TEST_SKIPPED;
   }
 
   return &servers;
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index d8e0b5f800a9552b12b76c4f40e668b8f6711266..3ba91459c3ab8fc696ed141c48a45fc63a35859a 100644 (file)
@@ -103,14 +103,14 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 
   if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == 0)
   {
-    error= TEST_FAILURE;
+    error= TEST_SKIPPED;
   }
 
   return &servers;
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   executable= "./clients/memflush";
   world->collections(collection);
index 5c3b6d529c3918f52d3a65e7f059c2bcd7e145f5..58da088c5d395cde9d662aba88b0feb3717d4581 100644 (file)
@@ -161,7 +161,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index 57b7c3554ef3a00bd4019dc9cf8ae88c1cb20905..c150082978a0ce971d87372a182748603b7188c2 100644 (file)
@@ -183,7 +183,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   executable= "./clients/memslap";
   world->collections(collection);
index b6053aeb20723da525e05e1345b56ed7b8ccf1ae..9b8cb836a380593ab9f266c35752dfac18b55f1f 100644 (file)
@@ -115,14 +115,14 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 
   if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
   {
-    error= TEST_FAILURE;
+    error= TEST_SKIPPED;
   }
 
   return &servers;
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
   world->create(world_create);
index 647485e44e9119964063b5f65f0c97c317479885..48cadcf232dde0d970bd0537ab71d1cec5965834 100644 (file)
@@ -147,14 +147,14 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 
   if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
   {
-    error= TEST_FAILURE;
+    error= TEST_SKIPPED;
   }
 
   return &servers;
 }
 
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   executable= "./clients/memtouch";
   world->collections(collection);
index 7078305336ea3f1c267b96e5a590606231e729f4..220d9ef5d8322bdfa37096d2fb7f1cc713416bde 100644 (file)
@@ -124,7 +124,7 @@ collection_st collection[] ={
   {0, 0, 0, 0}
 };
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
   world->collections(collection);
 }