server->address_info_next= NULL;
}
- char str_port[NI_MAXSERV];
- int length= snprintf(str_port, NI_MAXSERV, "%u", uint32_t(server->port()));
- if (length >= NI_MAXSERV or length <= 0)
+ char str_port[MEMCACHED_NI_MAXSERV];
+ int length= snprintf(str_port, MEMCACHED_NI_MAXSERV, "%u", uint32_t(server->port()));
+ if (length >= MEMCACHED_NI_MAXSERV or length <= 0)
{
- return MEMCACHED_FAILURE;
+ return memcached_set_error(*server, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
+ memcached_literal_param("snprintf(NI_MAXSERV)"));
}
struct addrinfo hints;
noinst_HEADERS+= libmemcached/csl/server.h
noinst_HEADERS+= libmemcached/csl/symbol.h
-libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/parser.h
-libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/scanner.h
libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/context.cc
libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/parser.cc
libmemcached_libmemcached_la_SOURCES+= libmemcached/csl/scanner.cc
MAINTAINERCLEANFILES+= libmemcached/csl/scanner.h
MAINTAINERCLEANFILES+= libmemcached/csl/scanner.cc
-BUILT_SOURCES+= libmemcached/csl/parser.h libmemcached/csl/scanner.h
+BUILT_SOURCES+= libmemcached/csl/parser.cc
+BUILT_SOURCES+= libmemcached/csl/parser.h
+BUILT_SOURCES+= libmemcached/csl/scanner.cc
+BUILT_SOURCES+= libmemcached/csl/scanner.h
libmemcached/csl/parser.h: libmemcached/csl/parser.cc
return rc;
}
- char hostname_port[NI_MAXHOST +NI_MAXSERV + sizeof("host : ")];
+ char hostname_port[MEMCACHED_NI_MAXHOST +MEMCACHED_NI_MAXSERV + sizeof("host : ")];
size_t size= append_host_to_string(self, hostname_port, sizeof(hostname_port));
memcached_string_t error_host= { hostname_port, size};
in_port_t port,
uint32_t weight)
{
- char buffer[NI_MAXHOST];
+ char buffer[MEMCACHED_NI_MAXHOST];
memcpy(buffer, hostname, hostname_length);
buffer[hostname_length]= 0;
*/
static memcached_return_t resolve_names(org::libmemcached::Instance& server, char *laddr, size_t laddr_length, char *raddr, size_t raddr_length)
{
- char host[NI_MAXHOST];
- char port[NI_MAXSERV];
+ char host[MEMCACHED_NI_MAXHOST];
+ char port[MEMCACHED_NI_MAXSERV];
struct sockaddr_storage saddr;
socklen_t salen= sizeof(saddr);
assert_msg(server->fd != INVALID_SOCKET, "Programmer error, invalid socket");
/* set ip addresses */
- char laddr[NI_MAXHOST + NI_MAXSERV];
- char raddr[NI_MAXHOST + NI_MAXSERV];
+ char laddr[MEMCACHED_NI_MAXHOST + MEMCACHED_NI_MAXSERV];
+ char raddr[MEMCACHED_NI_MAXHOST + MEMCACHED_NI_MAXSERV];
if (memcached_failed(rc= resolve_names(*server, laddr, sizeof(laddr), raddr, sizeof(raddr))))
{
{
private:
public:
- Gearmand(const std::string& host_arg, in_port_t port_arg, const char* binary= GEARMAND_BINARY);
+ Gearmand(const std::string& host_arg, in_port_t port_arg, bool libtool_, const char* binary);
bool ping()
{
bool build(size_t argc, const char *argv[]);
};
-Gearmand::Gearmand(const std::string& host_arg, in_port_t port_arg, const char* binary_arg) :
- libtest::Server(host_arg, port_arg, binary_arg, true)
+Gearmand::Gearmand(const std::string& host_arg, in_port_t port_arg, bool libtool_, const char* binary_arg) :
+ libtest::Server(host_arg, port_arg, binary_arg, libtool_)
{
set_pid_file();
}
namespace libtest {
-libtest::Server *build_gearmand(const char *hostname, in_port_t try_port)
-{
- return new Gearmand(hostname, try_port);
-}
-
libtest::Server *build_gearmand(const char *hostname, in_port_t try_port, const char* binary)
{
- return new Gearmand(hostname, try_port, binary);
+ if (binary == NULL)
+ {
+#if defined(GEARMAND_BINARY)
+ binary= GEARMAND_BINARY;
+#endif
+ }
+
+ if (binary == NULL)
+ {
+ return NULL;
+ }
+
+ bool is_libtool_script= true;
+
+ if (binary[0] == '/')
+ {
+ is_libtool_script= false;
+ }
+
+ return new Gearmand(hostname, try_port, is_libtool_script, binary);
}
}
namespace libtest {
-libtest::Server *build_gearmand(const char *hostname, in_port_t try_port);
-
-libtest::Server *build_gearmand(const char *hostname, in_port_t try_port, const char* binary);
+libtest::Server *build_gearmand(const char *hostname, in_port_t try_port, const char* binary= NULL);
}
endif
if HAVE_LIBDRIZZLE
-
libtest_libtest_la_LIBADD+= $(libdrizzle_LIBS)
libtest_libtest_la_CXXFLAGS+= $(libdrizzle_CFLAGS)
-
endif
if BUILDING_GEARMAN
libtest_unittest_DEPENDENCIES+= gearmand/gearmand
else
if HAVE_LIBGEARMAN
-libtest_libtest_la_LIBADD+= @LIBGEARMAN_LDFLAGS@
+libtest_libtest_la_LIBADD+= @LIBGEARMAN_LIB@
libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
libtest_libtest_la_SOURCES+= libtest/gearmand.cc
libtest_libtest_la_SOURCES+= util/instance.cc
std::ostream& operator<<(std::ostream& output, const libtest::Server &arg);
} // namespace libtest
-
-
#include <libmemcached-1.0/memcached.h>
#endif
-#if defined(LIBTEST_WITH_LIBGEARMAN_SUPPORT) && LIBTEST_WITH_LIBGEARMAN_SUPPORT
+#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN
#include <libgearman/gearman.h>
#endif
{
test_skip(true, HAVE_LIBGEARMAN);
test_skip(true, has_gearmand());
+#if defined(GEARMAND_BINARY)
+ if (GEARMAND_BINARY)
+ {
+ test_skip(0, access(GEARMAND_BINARY, X_OK ));
+ }
+ else
+ {
+ return TEST_SKIPPED;
+ }
+#endif
testing_service= "gearmand";
# (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 4
+#serial 5
AC_DEFUN([AX_ASSERT],
[AC_PREREQ([2.63])dnl
AC_REQUIRE([AX_DEBUG])
+ AC_REQUIRE([AX_VCS_CHECKOUT])
AC_ARG_ENABLE([assert],
[AS_HELP_STRING([--enable-assert],
- [Enable assert, this will be overridden by --enable-debug (yes|no) @<:@default=no@:>@])],[
- ax_enable_assert=yes
- ],[
- ax_enable_assert=no
- ])
+ [Enable assert, this will be overridden by --enable-debug (yes|no) @<:@default=no@:>@])],
+ [ax_enable_assert=yes],
+ [ax_enable_assert=no])
- AS_IF([ test "$ax_enable_assert" = "yes" -o "$ax_enable_debug" = "yes" ],[
- ax_enable_assert="yes"
+ AS_IF([ test "$ax_enable_assert" = "yes" -o "$ax_enable_debug" = "yes" -o "$ac_cv_vcs_checkout" = "yes" ],
+ [ax_enable_assert="yes"
AC_DEFINE(NDEBUG,[1],[Define to 1 to enable assert'ing code.])
])
-# serial 1
+# serial 2
AC_DEFUN([CHECK_FOR_LIBGEARMAND],
- [AX_CHECK_LIBRARY([LIBGEARMAN],[libgearman/gearman.h],[gearman],
- [ax_check_for_libgearman=yes],
- [ax_check_for_libgearman=no])
- AS_IF([test "$ax_check_for_libgearman" = xyes],
- [AC_DEFINE([HAVE_LIBGEARMAN],[1],[Enables libgearman Support])],
- [AC_DEFINE([HAVE_LIBGEARMAN],[0],[Enables libgearman Support])])
+ [AX_CHECK_LIBRARY([LIBGEARMAN],[libgearman/gearman.h],[gearman])
])
# All paths should be given relative to the root
if HAVE_RECENT_SPHINX
-
if IS_VCS_CHECKOUT
dist-hook: man
# Build rule for documentation
$(dist_man_MANS): man
-endif
-
BUILT_SOURCES+= $(dist_man_MANS)
+endif
+endif
+
dist_man_MANS+= man/memaslap.1
dist_man_MANS+= man/memcapable.1
dist_man_MANS+= man/memcat.1
dist_man_MANS+= man/memcached_touch_by_key.3
dist_man_MANS+= man/memcached_verbosity.3
dist_man_MANS+= man/memcached_version.3
-
-endif