From: Brian Aker Date: Tue, 18 Oct 2011 00:47:53 +0000 (-0700) Subject: Merge in updates for fixes to Hurd and license issue around hash for Redhat. X-Git-Tag: 1.0.2~4^2~2^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=6f88ba36f93b080d1d2c592ee8220e633ffa63fb;p=awesomized%2Flibmemcached Merge in updates for fixes to Hurd and license issue around hash for Redhat. --- diff --git a/clients/ms_conn.c b/clients/ms_conn.c index 755a2e5a..3a6fd8e7 100644 --- a/clients/ms_conn.c +++ b/clients/ms_conn.c @@ -2125,6 +2125,7 @@ static int ms_add_iov(ms_conn_t *c, const void *buf, int len) */ limit_to_mtu= c->udp; +#ifdef IOV_MAX /* We may need to start a new msghdr if this one is full. */ if ((m->msg_iovlen == IOV_MAX) || (limit_to_mtu && (c->msgbytes >= UDP_MAX_SEND_PAYLOAD_SIZE))) @@ -2132,6 +2133,7 @@ static int ms_add_iov(ms_conn_t *c, const void *buf, int len) ms_add_msghdr(c); m= &c->msglist[c->msgused - 1]; } +#endif if (ms_ensure_iov_space(c) != 0) return -1; diff --git a/libhashkit/algorithm.cc b/libhashkit/algorithm.cc index 37d1cb43..015370fd 100644 --- a/libhashkit/algorithm.cc +++ b/libhashkit/algorithm.cc @@ -1,9 +1,37 @@ -/* HashKit - * Copyright (C) 2006-2009 Brian Aker - * All rights reserved. +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * HashKit library + * + * Copyright (C) 2006-2011 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. * - * Use and distribution licensed under the BSD license. See - * the COPYING file in the parent directory for full text. */ #include diff --git a/libhashkit/common.h b/libhashkit/common.h index 4dece00f..e840e46d 100644 --- a/libhashkit/common.h +++ b/libhashkit/common.h @@ -1,11 +1,40 @@ -/* HashKit - * Copyright (C) 2009 Brian Aker - * All rights reserved. +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * HashKit library + * + * Copyright (C) 2011 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. * - * Use and distribution licensed under the BSD license. See - * the COPYING file in the parent directory for full text. */ + #pragma once #include diff --git a/libhashkit/include.am b/libhashkit/include.am index d9b769f6..454c4118 100644 --- a/libhashkit/include.am +++ b/libhashkit/include.am @@ -29,7 +29,6 @@ libhashkit_libhashkit_la_SOURCES= \ libhashkit/function.cc \ libhashkit/has.cc \ libhashkit/hashkit.cc \ - libhashkit/hsieh.cc \ libhashkit/jenkins.cc \ libhashkit/ketama.cc \ libhashkit/md5.cc \ @@ -38,6 +37,11 @@ libhashkit_libhashkit_la_SOURCES= \ libhashkit/str_algorithm.cc \ libhashkit/strerror.cc +if INCLUDE_HSIEH_SRC +libhashkit_libhashkit_la_SOURCES+= libhashkit/hsieh.cc +else +libhashkit_libhashkit_la_SOURCES+= libhashkit/nohsieh.cc +endif libhashkit_libhashkit_la_CPPFLAGS= -DBUILDING_HASHKIT diff --git a/libhashkit/nohsieh.cc b/libhashkit/nohsieh.cc new file mode 100644 index 00000000..8def9939 --- /dev/null +++ b/libhashkit/nohsieh.cc @@ -0,0 +1,46 @@ +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * HashKit library + * + * Copyright (C) 2011 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 + +#ifdef HAVE_HSIEH_HASH +#error "not supported" +#else +uint32_t hashkit_hsieh(const char *, size_t , void *) +{ + return 0; +} +#endif