debian/0000755000000000000000000000000012144073632007170 5ustar debian/changelog0000644000000000000000000000023612143171033011034 0ustar libwebsockets (1.2.2-1) unstable; urgency=low * Initial release (closes: #697671). -- Peter Pentchev Thu, 28 Mar 2013 19:10:28 +0200 debian/clean0000644000000000000000000000005212125075261010171 0ustar libwebsockets.3 libwebsockets-api-doc.txt debian/compat0000644000000000000000000000000212125075261010365 0ustar 9 debian/control0000644000000000000000000000440712143212056010572 0ustar Source: libwebsockets Section: libs Priority: optional Maintainer: Peter Pentchev Uploaders: Laszlo Boszormenyi (GCS) Build-Depends: debhelper (>= 9), dh-autoreconf, libssl-dev, openssl, zlib1g-dev Standards-Version: 3.9.4 Homepage: http://www.libwebsockets.org/ Vcs-Git: git://anonscm.debian.org/collab-maint/libwebsockets.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/libwebsockets.git Package: libwebsockets3 Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} Description: lightweight C websockets library Libwebsockets is a lightweight pure C library for both websockets clients and servers built to use minimal CPU and memory resources and provide fast throughput in both directions. . This package contains the shared library. Package: libwebsockets-dev Section: libdevel Architecture: any Multi-Arch: same Depends: libwebsockets3 (= ${binary:Version}), ${misc:Depends} Description: lightweight C websockets library - development files Libwebsockets is a lightweight pure C library for both websockets clients and servers built to use minimal CPU and memory resources and provide fast throughput in both directions. . This package contains the header files needed for developing programs using libwebsockets and a static library. Package: libwebsockets3-dbg Section: debug Priority: extra Architecture: any Multi-Arch: same Depends: libwebsockets3 (= ${binary:Version}), ${misc:Depends} Description: lightweight C websockets library - debug symbols Libwebsockets is a lightweight pure C library for both websockets clients and servers built to use minimal CPU and memory resources and provide fast throughput in both directions. . This package contains the debugging symbols for the library. Package: libwebsockets-test-server Section: utils Architecture: any Multi-Arch: foreign Depends: libwebsockets3 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: lightweight C websockets library - test servers Libwebsockets is a lightweight pure C library for both websockets clients and servers built to use minimal CPU and memory resources and provide fast throughput in both directions. . This package contains several demonstration test servers. debian/copyright0000644000000000000000000003143112143214710011116 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: libwebsockets Source: http://www.libwebsockets.org/ License: LGPL-2.1 Files: lib/base64-decode.c Copyright: (C) 2001 Bob Trower, Trantor Standard Systems Inc. License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Files: lib/client.c lib/client-parser.c lib/handshake.c lib/output.c lib/parsers.c lib/private-libwebsockets.h lib/server.c lib/server-handshake.c test-server/test-client.c test-server/test-echo.c test-server/test-echo.c test-server/test-fraggle.c test-server/test-server.c Copyright: (C) 2010-2013 Andy Green License: LGPL-2.1 Files: lib/getifaddrs.c Copyright: (C) 2000 - 2001 Kungliga Tekniska Högskolan License: BSD-3-Institute Files: lib/getifaddrs.h Copyright: (C) 2000 Kungliga Tekniska Högskolan License: BSD-3-Institute Files: lib/libwebsockets.c lib/libwebsockets.h Copyright: (C) 2010 Andy Green License: LGPL-2.1 Files: lib/sha-1.c Copyright: (C) 1995, 1996, 1997, and 1998 WIDE Project. License: BSD-3-WIDE Files: README.test-apps Copyright: (C) 2010-2011 Andy Green License: LGPL-2.1 Files: scripts/kernel-doc Copyright: (C) 1998 Michael Zucchi, All Rights Reserved (C) 2000, 1 Tim Waugh (C) 2001 Simon Huggins (C) 2005-2009 Randy Dunlap (C) 2000 MontaVista Software, Inc. License: GPL-2+ This software falls under the GNU General Public License. Please read the COPYING file for more information . 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 2 of the License, or (at your option) any later version. . On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2' Files: test-server/test-ping.c Copyright: (C) 2011 Andy Green License: LGPL-2.1 Files: win32port/win32helpers/getopt.c Copyright: (C) 1987, 1993, 1994 The Regents of the University of California License: BSD-4-UC Files: win32port/win32helpers/getopt_long.c Copyright: (C) 1987, 1993, 1994, 1996 The Regents of the University of California License: BSD-4-UC Files: win32port/zlib/adler32.c Copyright: (C) 1995-2007 Mark Adler License: BSD-3-zlib Files: win32port/zlib/compress.c Copyright: (C) 1995-2005 Jean-loup Gailly. License: BSD-3-zlib Files: win32port/zlib/crc32.c Copyright: (C) 1995-2006, 2010 Mark Adler License: BSD-3-zlib Files: win32port/zlib/deflate.c win32port/zlib/zlib.h Copyright: (C) 1995-2010 Jean-loup Gailly and Mark Adler License: BSD-3-zlib Files: win32port/zlib/deflate.h win32port/zlib/trees.c win32port/zlib/zconf.h win32port/zlib/zutil.h Copyright: (C) 1995-2010 Jean-loup Gailly License: BSD-3-zlib Files: win32port/zlib/gzclose.c win32port/zlib/gzlib.c Copyright: (C) 2004, 2010 Mark Adler License: BSD-3-zlib Files: win32port/zlib/gzguts.h win32port/zlib/gzread.c win32port/zlib/gzwrite.c Copyright: (C) 2004, 2005, 2010 Mark Adler License: BSD-3-zlib Files: win32port/zlib/gzio.c Copyright: (C) 1995-2003 Jean-loup Gailly. License: BSD-3-zlib Files: win32port/zlib/infback.c win32port/zlib/inflate.h Copyright: (C) 1995-2009 Mark Adler License: BSD-3-zlib Files: win32port/zlib/inffast.c Copyright: (C) 1995-2008, 2010 Mark Adler License: BSD-3-zlib Files: win32port/zlib/inffast.h Copyright: (C) 1995-2003, 2010 Mark Adler License: BSD-3-zlib Files: win32port/zlib/inflate.c win32port/zlib/inftrees.c Copyright: (C) 1995-2010 Mark Adler License: BSD-3-zlib Files: win32port/zlib/inftrees.h Copyright: (C) 1995-2005, 2010 Mark Adler License: BSD-3-zlib Files: win32port/zlib/uncompr.c Copyright: (C) 1995-2003, 2010 Jean-loup Gailly. License: BSD-3-zlib Files: win32port/zlib/zutil.c Copyright: (C) 1995-2005, 2010 Jean-loup Gailly. License: BSD-3-zlib Files: debian/* Copyright: (C) 2013 Peter Pentchev , (C) 2013 Laszlo Boszormenyi (GCS) License: LGPL-2.1 License: BSD-3 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. 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. . 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. License: LGPL-2.1 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation: version 2.1 of the License. . This library 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 Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA License: BSD-3-Institute All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. 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. . 3. Neither the name of the Institute nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE 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. License: BSD-3-WIDE All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. Neither the name of the project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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. License: BSD-4-UC All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors. 4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. License: BSD-3-zlib This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. . Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: . 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. debian/dehs-to-shell.awk0000644000000000000000000000014212125075261012340 0ustar #!/usr/bin/awk -f $4 ~ /^\// { gsub(/-/, "_", $2); gsub(/'/, "_", $3); print $2 "='" $3 "'" } debian/get-orig-source.sh0000644000000000000000000000311512125075261012536 0ustar #!/bin/sh set -e eval `uscan --report --dehs | awk -F'[<>]' -f debian/dehs-to-shell.awk` upstream_tarball=`echo "$upstream_url" | sed -e 's@.*/@@'` upstream_dir=`basename "$upstream_tarball" '.tar.gz'` for i in package debian_uversion debian_mangled_uversion upstream_version \ upstream_url upstream_tarball; do eval "val=\"\$$i\"" if [ -z "$val" ]; then echo "uscan --report --dehs did not provide $i" exit 1 fi done # We will need orig_dir if we ever need to actually repack - as in # remove or replace files, directories, etc. # #orig_dir="$package-$debian_uversion.orig" orig_name="${package}_$debian_uversion.orig" orig_tarball="$orig_name.tar.gz" up_dir="`pwd`/../tarballs" # Fetch the upstream tarball if needed mkdir -p "$up_dir" if [ ! -f "$up_dir/$upstream_tarball" ]; then echo "Fetching upstream tarball $up_dir/$upstream_tarball" (cd "$up_dir" && wget -nv -c "$upstream_url") else echo "Upstream tarball $up_dir/$upstream_tarball exists"; fi # Nothing to remove or replace so we do not even need to extract, # merely copy to the new tarball name. # Yes, this will keep dpkg-source complaining about the directory # name mismatch - just as it does on pretty much any other package ;) # rm -f "$up_dir/$orig_tarball" if [ -e "$up_dir/$orig_tarball" ]; then echo "Could not remove $up_dir/$orig_tarball" 1>&2 exit 1 fi # Try to link first, if not, then copy if ! ln "$up_dir/$upstream_tarball" "$up_dir/$orig_tarball" || [ ! -f "$up_dir/$orig_tarball" ]; then cp "$up_dir/$upstream_tarball" "$up_dir/$orig_tarball" fi echo "The repackaged source is at $up_dir/$orig_tarball" debian/libwebsockets-dev.doc-base0000644000000000000000000000075212143166603014207 0ustar Document: libwebsockets-api-doc Title: libwebsockets API Reference Author: Andy Green Abstract: This reference describes the Application Programming Interface for libwebsockets, the lightweight C websockets library. Section: Programming/C Format: Text Files: /usr/share/doc/libwebsockets-dev/libwebsockets-api-doc.txt.gz Format: HTML Index: /usr/share/doc/libwebsockets-dev/libwebsockets-api-doc.html Files: /usr/share/doc/libwebsockets-dev/libwebsockets-api-doc.html debian/libwebsockets-dev.docs0000644000000000000000000000010312125075261013447 0ustar libwebsockets-api-doc.html libwebsockets-api-doc.txt README.coding debian/libwebsockets-dev.install0000644000000000000000000000010712125075261014171 0ustar usr/include/* usr/lib/*/lib*.a usr/lib/*/lib*.so usr/lib/*/pkgconfig/* debian/libwebsockets-test-server.install0000644000000000000000000000007512125075261015702 0ustar usr/bin/libwebsockets* usr/share/libwebsockets-test-server/* debian/libwebsockets-test-server.lintian-overrides0000644000000000000000000000036212125075261017671 0ustar # The only GPL-licensed thing in the package is a Perl script used for # creating the API reference. There is no GPL-licensed code in either # the library or the test tools. # libwebsockets-test-server: possible-gpl-code-linked-with-openssl debian/libwebsockets3.install0000644000000000000000000000002412125075261013476 0ustar usr/lib/*/lib*.so.* debian/libwebsockets3.lintian-overrides0000644000000000000000000000034712125075261015476 0ustar # The only GPL-licensed thing in the package is a Perl script used for # creating the API reference. There is no GPL-licensed code in either # the library or the test tools. # libwebsockets3: possible-gpl-code-linked-with-openssl debian/libwebsockets3.symbols0000644000000000000000000000247312125075261013532 0ustar libwebsockets.so.3 libwebsockets3 #MINVER# _lws_log@Base 1.2 libwebsocket_callback_on_writable@Base 1.2 libwebsocket_callback_on_writable_all_protocol@Base 1.2 libwebsocket_canonical_hostname@Base 1.2 libwebsocket_client_connect@Base 1.2 libwebsocket_client_connect_extended@Base 1.2 libwebsocket_context_destroy@Base 1.2 libwebsocket_context_user@Base 1.2 libwebsocket_create_context@Base 1.2 libwebsocket_ensure_user_space@Base 1.2 libwebsocket_get_internal_extensions@Base 1.2 libwebsocket_get_reserved_bits@Base 1.2 libwebsocket_get_socket_fd@Base 1.2 libwebsocket_is_final_fragment@Base 1.2 libwebsocket_read@Base 1.2 libwebsocket_rx_flow_control@Base 1.2 libwebsocket_service@Base 1.2 libwebsocket_service_fd@Base 1.2 libwebsocket_write@Base 1.2 libwebsockets_get_peer_addresses@Base 1.2 libwebsockets_get_protocol@Base 1.2 libwebsockets_get_random@Base 1.2 libwebsockets_remaining_packet_payload@Base 1.2 libwebsockets_serve_http_file@Base 1.2 libwebsockets_serve_http_file_fragment@Base 1.2 lws_b64_decode_string@Base 1.2 lws_b64_encode_string@Base 1.2 lws_daemonize@Base 1.2 lws_frame_is_binary@Base 1.2 lws_get_library_version@Base 1.2 lws_hdr_copy@Base 1.2 lws_hdr_total_length@Base 1.2 lws_send_pipe_choked@Base 1.2 lws_set_log_level@Base 1.2 lwsl_emit_syslog@Base 1.2 lwsl_hexdump@Base 1.2 debian/patches/0000755000000000000000000000000012125075330010613 5ustar debian/patches/0001-getnameinfo.patch0000644000000000000000000000353312125075261014515 0ustar Description: Fix the client's canonical hostname handling. Origin: upstream; http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit?id=adc71469da29a418ff71e68ff7b2d2d189a2063f Author: Andy Green Last-Update: 2013-02-19 commit adc71469da29a418ff71e68ff7b2d2d189a2063f Author: Andy Green Date: Thu Feb 14 17:11:22 2013 +0800 just get hostname into canonical_hostname Signed-off-by: Andy Green --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1750,40 +1750,8 @@ #ifndef LWS_NO_SERVER if (!(info->options & LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME)) { - struct sockaddr sa; - context->service_buffer[0] = '\0'; - /* find canonical hostname */ - - context->service_buffer[ - sizeof(context->service_buffer) - 1] = '\0'; - memset(&sa, 0, sizeof(sa)); - sa.sa_family = AF_INET; - sa.sa_data[sizeof(sa.sa_data) - 1] = '\0'; - gethostname((char *)context->service_buffer, - sizeof(context->service_buffer) - 1); - - n = 0; - - if (strlen((char *)context->service_buffer) < - sizeof(sa.sa_data) - 1) { - strcpy(sa.sa_data, (char *)context->service_buffer); - lwsl_debug("my host name is %s\n", sa.sa_data); - n = getnameinfo(&sa, sizeof(sa), - (char *)context->service_buffer, - sizeof(context->service_buffer) - 1, - NULL, 0, NI_NAMEREQD); - } - - if (!n) { - strncpy(context->canonical_hostname, - (char *)context->service_buffer, - sizeof(context->canonical_hostname) - 1); - context->canonical_hostname[ - sizeof(context->canonical_hostname) - 1] = '\0'; - } else - strncpy(context->canonical_hostname, - (char *)context->service_buffer, + gethostname((char *)context->canonical_hostname, sizeof(context->canonical_hostname) - 1); lwsl_notice(" canonical_hostname = %s\n", debian/patches/0002-keepalive.patch0000644000000000000000000000204712125075261014166 0ustar Description: Fix the socket keepalive code. Origin: upstream; http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit?id=bb66ac6ec13092d5f7ef2f8a199605fc95e25cba Author: Andy Green Last-Update: 2013-02-23 commit bb66ac6ec13092d5f7ef2f8a199605fc95e25cba Author: Larry Hayes Date: Fri Feb 22 09:16:20 2013 +0800 keepalive swap interval and probes The interval and probes members for setting keepalive options per-connection on Linux were swapped. Signed-off-by: Larry Hayes --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -575,12 +575,12 @@ (const void *)&optval, optlen) < 0) return 1; - optval = context->ka_probes; + optval = context->ka_interval; if (setsockopt(fd, IPPROTO_IP, TCP_KEEPINTVL, (const void *)&optval, optlen) < 0) return 1; - optval = context->ka_interval; + optval = context->ka_probes; if (setsockopt(fd, IPPROTO_IP, TCP_KEEPCNT, (const void *)&optval, optlen) < 0) return 1; debian/patches/01-visibility.patch0000644000000000000000000004073712125075330014254 0ustar Description: Hide private library symbols. Forwarded: http://libwebsockets.org/trac/ticket/24 Author: Peter Pentchev Last-Update: 2013-02-19 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -65,7 +65,7 @@ libwebsockets_la_CFLAGS+= -w -I../win32port/win32helpers -I ../win32port/zlib/ libwebsockets_la_LDFLAGS+= -lm -luser32 -ladvapi32 -lkernel32 -lgcc else -libwebsockets_la_CFLAGS+= -rdynamic -fPIC -Werror +libwebsockets_la_CFLAGS+= -rdynamic -fPIC -Werror -fvisibility=hidden # notice http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html has rules for how to bump this libwebsockets_la_LDFLAGS+= -version-info 3:0:0 endif --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -46,8 +46,10 @@ #ifdef LWS_DLL #ifdef LWS_INTERNAL +#define LWS_VISIBLE #define LWS_EXTERN extern __declspec(dllexport) #else +#define LWS_VISIBLE #define LWS_EXTERN extern __declspec(dllimport) #endif #endif @@ -55,6 +57,13 @@ #else // NOT WIN32 #include #include + +#if defined(__GNUC__) +#define LWS_VISIBLE __attribute__((visibility("default"))) +#else +#define LWS_VISIBLE +#endif + #endif #include @@ -81,7 +90,7 @@ LLL_COUNT = 10 /* set to count of valid flags */ }; -LWS_EXTERN void _lws_log(int filter, const char *format, ...); +LWS_VISIBLE LWS_EXTERN void _lws_log(int filter, const char *format, ...); /* notice, warn and log are always compiled in */ #define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__) @@ -101,7 +110,7 @@ #define lwsl_ext(...) _lws_log(LLL_EXT, __VA_ARGS__) #define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__) #define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__) -LWS_EXTERN void lwsl_hexdump(void *buf, size_t len); +LWS_VISIBLE LWS_EXTERN void lwsl_hexdump(void *buf, size_t len); #else /* no debug */ @@ -586,7 +595,7 @@ * pollfd struct for this socket descriptor. If you are using the * internal polling loop, you can just ignore it. */ -LWS_EXTERN int callback(struct libwebsocket_context *context, +LWS_VISIBLE LWS_EXTERN int callback(struct libwebsocket_context *context, struct libwebsocket *wsi, enum libwebsocket_callback_reasons reason, void *user, void *in, size_t len); @@ -655,7 +664,7 @@ * buffer safely, it should copy the data into its own buffer and * set the lws_tokens token pointer to it. */ -LWS_EXTERN int extension_callback(struct libwebsocket_context *context, +LWS_VISIBLE LWS_EXTERN int extension_callback(struct libwebsocket_context *context, struct libwebsocket_extension *ext, struct libwebsocket *wsi, enum libwebsocket_extension_callback_reasons reason, @@ -787,27 +796,27 @@ }; -LWS_EXTERN +LWS_VISIBLE LWS_EXTERN void lws_set_log_level(int level, void (*log_emit_function)(int level, const char *line)); -LWS_EXTERN void +LWS_VISIBLE LWS_EXTERN void lwsl_emit_syslog(int level, const char *line); -LWS_EXTERN struct libwebsocket_context * +LWS_VISIBLE LWS_EXTERN struct libwebsocket_context * libwebsocket_create_context(struct lws_context_creation_info *info); -LWS_EXTERN void +LWS_VISIBLE LWS_EXTERN void libwebsocket_context_destroy(struct libwebsocket_context *context); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_service(struct libwebsocket_context *context, int timeout_ms); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_service_fd(struct libwebsocket_context *context, struct pollfd *pollfd); -LWS_EXTERN void * +LWS_VISIBLE LWS_EXTERN void * libwebsocket_context_user(struct libwebsocket_context *context); /* @@ -844,48 +853,48 @@ #define LWS_SEND_BUFFER_PRE_PADDING (4 + 10 + (2 * MAX_MUX_RECURSION)) #define LWS_SEND_BUFFER_POST_PADDING 4 -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len, enum libwebsocket_write_protocol protocol); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsockets_serve_http_file(struct libwebsocket_context *context, struct libwebsocket *wsi, const char *file, const char *content_type); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsockets_serve_http_file_fragment(struct libwebsocket_context *context, struct libwebsocket *wsi); -LWS_EXTERN const struct libwebsocket_protocols * +LWS_VISIBLE LWS_EXTERN const struct libwebsocket_protocols * libwebsockets_get_protocol(struct libwebsocket *wsi); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_callback_on_writable(struct libwebsocket_context *context, struct libwebsocket *wsi); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_callback_on_writable_all_protocol( const struct libwebsocket_protocols *protocol); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_get_socket_fd(struct libwebsocket *wsi); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_is_final_fragment(struct libwebsocket *wsi); -LWS_EXTERN unsigned char +LWS_VISIBLE LWS_EXTERN unsigned char libwebsocket_get_reserved_bits(struct libwebsocket *wsi); -LWS_EXTERN void * +LWS_VISIBLE LWS_EXTERN void * libwebsocket_ensure_user_space(struct libwebsocket *wsi); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable); -LWS_EXTERN size_t +LWS_VISIBLE LWS_EXTERN size_t libwebsockets_remaining_packet_payload(struct libwebsocket *wsi); -LWS_EXTERN struct libwebsocket * +LWS_VISIBLE LWS_EXTERN struct libwebsocket * libwebsocket_client_connect(struct libwebsocket_context *clients, const char *address, int port, @@ -896,7 +905,7 @@ const char *protocol, int ietf_version_or_minus_one); -LWS_EXTERN struct libwebsocket * +LWS_VISIBLE LWS_EXTERN struct libwebsocket * libwebsocket_client_connect_extended(struct libwebsocket_context *clients, const char *address, int port, @@ -908,46 +917,46 @@ int ietf_version_or_minus_one, void *userdata); -LWS_EXTERN const char * +LWS_VISIBLE LWS_EXTERN const char * libwebsocket_canonical_hostname(struct libwebsocket_context *context); -LWS_EXTERN void +LWS_VISIBLE LWS_EXTERN void libwebsockets_get_peer_addresses(struct libwebsocket_context *context, struct libwebsocket *wsi, int fd, char *name, int name_len, char *rip, int rip_len); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsockets_get_random(struct libwebsocket_context *context, void *buf, int len); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_daemonize(const char *_lock_path); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_send_pipe_choked(struct libwebsocket *wsi); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_frame_is_binary(struct libwebsocket *wsi); -LWS_EXTERN unsigned char * +LWS_VISIBLE LWS_EXTERN unsigned char * libwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_b64_encode_string(const char *in, int in_len, char *out, int out_size); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_b64_decode_string(const char *in, char *out, int out_size); -LWS_EXTERN const char * +LWS_VISIBLE LWS_EXTERN const char * lws_get_library_version(void); /* access to headers... only valid while headers valid */ -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h); -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int lws_hdr_copy(struct libwebsocket *wsi, char *dest, int len, enum lws_token_indexes h); @@ -956,13 +965,13 @@ * useful when integrating with other app poll loop service code. */ -LWS_EXTERN int +LWS_VISIBLE LWS_EXTERN int libwebsocket_read(struct libwebsocket_context *context, struct libwebsocket *wsi, unsigned char *buf, size_t len); #ifndef LWS_NO_EXTENSIONS -LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions(); +LWS_VISIBLE LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions(); #endif #ifdef __cplusplus --- a/lib/daemonize.c +++ b/lib/daemonize.c @@ -21,6 +21,8 @@ #include #include +#include "private-libwebsockets.h" + int pid_daemon; static char *lock_path; @@ -89,7 +91,7 @@ * The process context you called from has been terminated then. */ -int +LWS_VISIBLE int lws_daemonize(const char *_lock_path) { pid_t sid, parent; --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -91,7 +91,7 @@ * was built from */ -const char * +LWS_VISIBLE const char * lws_get_library_version(void) { return library_version; @@ -443,7 +443,7 @@ * determined, they will be returned as valid zero-length strings. */ -void +LWS_VISIBLE void libwebsockets_get_peer_addresses(struct libwebsocket_context *context, struct libwebsocket *wsi, int fd, char *name, int name_len, char *rip, int rip_len) @@ -516,7 +516,7 @@ lws_latency(context, wsi, "libwebsockets_get_peer_addresses", ret, 1); } -int libwebsockets_get_random(struct libwebsocket_context *context, +LWS_VISIBLE int libwebsockets_get_random(struct libwebsocket_context *context, void *buf, int len) { int n; @@ -606,7 +606,7 @@ return 0; } -int lws_send_pipe_choked(struct libwebsocket *wsi) +LWS_VISIBLE int lws_send_pipe_choked(struct libwebsocket *wsi) { struct pollfd fds; @@ -805,7 +805,7 @@ * including listen accepts, http files as well as websocket protocol. */ -int +LWS_VISIBLE int libwebsocket_service_fd(struct libwebsocket_context *context, struct pollfd *pollfd) { @@ -1067,7 +1067,7 @@ * context. After calling this, any further use of the context is * undefined. */ -void +LWS_VISIBLE void libwebsocket_context_destroy(struct libwebsocket_context *context) { #ifndef LWS_NO_EXTENSIONS @@ -1194,7 +1194,7 @@ * nothing is pending, or as soon as it services whatever was pending. */ -int +LWS_VISIBLE int libwebsocket_service(struct libwebsocket_context *context, int timeout_ms) { int n; @@ -1278,7 +1278,7 @@ * @wsi: Websocket connection instance to get callback for */ -int +LWS_VISIBLE int libwebsocket_callback_on_writable(struct libwebsocket_context *context, struct libwebsocket *wsi) { @@ -1326,7 +1326,7 @@ * @protocol: Protocol whose connections will get callbacks */ -int +LWS_VISIBLE int libwebsocket_callback_on_writable_all_protocol( const struct libwebsocket_protocols *protocol) { @@ -1376,7 +1376,7 @@ * @wsi: Websocket connection instance */ -int +LWS_VISIBLE int libwebsocket_get_socket_fd(struct libwebsocket *wsi) { return wsi->sock; @@ -1490,7 +1490,7 @@ * @enable: 0 = disable read servicing for this connection, 1 = enable */ -int +LWS_VISIBLE int libwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable) { wsi->u.ws.rxflow_change_to = 2 | !!enable; @@ -1510,7 +1510,7 @@ */ -extern const char * +LWS_VISIBLE extern const char * libwebsocket_canonical_hostname(struct libwebsocket_context *context) { return (const char *)context->canonical_hostname; @@ -1600,7 +1600,7 @@ * one place; they're all handled in the user callback. */ -struct libwebsocket_context * +LWS_VISIBLE struct libwebsocket_context * libwebsocket_create_context(struct lws_context_creation_info *info) { struct libwebsocket_context *context = NULL; @@ -2132,25 +2132,25 @@ * this is how you can get a pointer to the active protocol if needed. */ -const struct libwebsocket_protocols * +LWS_VISIBLE const struct libwebsocket_protocols * libwebsockets_get_protocol(struct libwebsocket *wsi) { return wsi->protocol; } -int +LWS_VISIBLE int libwebsocket_is_final_fragment(struct libwebsocket *wsi) { return wsi->u.ws.final; } -unsigned char +LWS_VISIBLE unsigned char libwebsocket_get_reserved_bits(struct libwebsocket *wsi) { return wsi->u.ws.rsv; } -void * +LWS_VISIBLE void * libwebsocket_ensure_user_space(struct libwebsocket *wsi) { /* allocate the per-connection user memory (if any) */ @@ -2188,12 +2188,12 @@ } #ifdef WIN32 -void lwsl_emit_syslog(int level, const char *line) +LWS_VISIBLE void lwsl_emit_syslog(int level, const char *line) { lwsl_emit_stderr(level, line); } #else -void lwsl_emit_syslog(int level, const char *line) +LWS_VISIBLE void lwsl_emit_syslog(int level, const char *line) { int syslog_level = LOG_DEBUG; @@ -2215,7 +2215,7 @@ } #endif -void _lws_log(int filter, const char *format, ...) +LWS_VISIBLE void _lws_log(int filter, const char *format, ...) { char buf[256]; va_list ap; @@ -2242,7 +2242,7 @@ * emission on stderr. */ -void lws_set_log_level(int level, void (*log_emit_function)(int level, +LWS_VISIBLE void lws_set_log_level(int level, void (*log_emit_function)(int level, const char *line)) { log_level = level; --- a/lib/output.c +++ b/lib/output.c @@ -48,7 +48,7 @@ #ifdef _DEBUG -void lwsl_hexdump(void *vbuf, size_t len) +LWS_VISIBLE void lwsl_hexdump(void *vbuf, size_t len) { int n; int m; @@ -276,7 +276,7 @@ * packet while not burdening the user code with any protocol knowledge. */ -int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, +LWS_VISIBLE int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len, enum libwebsocket_write_protocol protocol) { int n; @@ -479,7 +479,7 @@ return lws_issue_raw_ext_access(wsi, buf - pre, len + pre + post); } -int libwebsockets_serve_http_file_fragment( +LWS_VISIBLE int libwebsockets_serve_http_file_fragment( struct libwebsocket_context *context, struct libwebsocket *wsi) { int ret = 0; @@ -533,7 +533,7 @@ * the wsi should be left alone. */ -int libwebsockets_serve_http_file(struct libwebsocket_context *context, +LWS_VISIBLE int libwebsockets_serve_http_file(struct libwebsocket_context *context, struct libwebsocket *wsi, const char *file, const char *content_type) { --- a/lib/base64-decode.c +++ b/lib/base64-decode.c @@ -48,7 +48,7 @@ static const char decode[] = "|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW" "$$$$$$XYZ[\\]^_`abcdefghijklmnopq"; -int +LWS_VISIBLE int lws_b64_encode_string(const char *in, int in_len, char *out, int out_size) { unsigned char triple[3]; @@ -97,7 +97,7 @@ * according to out_size */ -int +LWS_VISIBLE int lws_b64_decode_string(const char *in, char *out, int out_size) { int len; --- a/lib/client-handshake.c +++ b/lib/client-handshake.c @@ -154,7 +154,7 @@ * This function creates a connection to a remote server */ -struct libwebsocket * +LWS_VISIBLE struct libwebsocket * libwebsocket_client_connect(struct libwebsocket_context *context, const char *address, int port, @@ -305,7 +305,7 @@ * This function creates a connection to a remote server */ -struct libwebsocket * +LWS_VISIBLE struct libwebsocket * libwebsocket_client_connect_extended(struct libwebsocket_context *context, const char *address, int port, --- a/lib/extension.c +++ b/lib/extension.c @@ -27,7 +27,7 @@ } }; -struct libwebsocket_extension *libwebsocket_get_internal_extensions() +LWS_VISIBLE struct libwebsocket_extension *libwebsocket_get_internal_extensions() { return libwebsocket_internal_extensions; } --- a/lib/handshake.c +++ b/lib/handshake.c @@ -53,7 +53,7 @@ * machine that is completely independent of packet size. */ -int +LWS_VISIBLE int libwebsocket_read(struct libwebsocket_context *context, struct libwebsocket *wsi, unsigned char *buf, size_t len) { --- a/lib/parsers.c +++ b/lib/parsers.c @@ -321,7 +321,7 @@ return 0; } -int lws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h) +LWS_VISIBLE int lws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h) { int n; int len = 0; @@ -338,7 +338,7 @@ return len; } -int lws_hdr_copy(struct libwebsocket *wsi, char *dest, int len, +LWS_VISIBLE int lws_hdr_copy(struct libwebsocket *wsi, char *dest, int len, enum lws_token_indexes h) { int toklen = lws_hdr_total_length(wsi, h); @@ -625,7 +625,7 @@ * mode. */ -int lws_frame_is_binary(struct libwebsocket *wsi) +LWS_VISIBLE int lws_frame_is_binary(struct libwebsocket *wsi) { return wsi->u.ws.frame_is_binary; } @@ -1155,7 +1155,7 @@ * Many protocols won't care becuse their packets are always small. */ -size_t +LWS_VISIBLE size_t libwebsockets_remaining_packet_payload(struct libwebsocket *wsi) { return wsi->u.ws.rx_packet_length; --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1722,6 +1722,7 @@ my $prototype = shift; my $file = shift; + $prototype =~ s/LWS_VISIBLE +//; $prototype =~ s/^static +//; $prototype =~ s/^extern +//; $prototype =~ s/^asmlinkage +//; debian/patches/series0000644000000000000000000000010012125075261012022 0ustar 0001-getnameinfo.patch 0002-keepalive.patch 01-visibility.patch debian/rules0000755000000000000000000000103512143166542010251 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Debian debhelper package build rules for libwebsockets # Aim for the top, adapt if anything should break on the buildds. DEB_BUILD_MAINT_OPTIONS= hardening=+all export DEB_BUILD_MAINT_OPTIONS %: dh $@ --parallel --dbg-package=libwebsockets3-dbg --with autoreconf override_dh_auto_configure: dh_auto_configure -- --enable-openssl --enable-libcrypto get-orig-source: . debian/get-orig-source.sh .PHONY: override_dh_auto_configure debian/source/0000755000000000000000000000000012125075261010467 5ustar debian/source/format0000644000000000000000000000001412125075261011675 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000032512143213342010212 0ustar version=3 opts="uversionmangle=s/^([1-9][0-9]*\.[0-9])([1-9])/$1.$2/" \ http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/refs/ .*libwebsockets-([1-9][0-9.]*)[a-z0-9.-]*\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz))