diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac8f968 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so +*.pyc + +# Logs and databases # +###################### +*.log + +# OS generated files # +###################### +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db diff --git a/COPYING b/COPYING index b1e3f5a..15a6fe9 100644 --- a/COPYING +++ b/COPYING @@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an diff --git a/ChangeLog b/ChangeLog index 37f829a..5497091 100644 --- a/ChangeLog +++ b/ChangeLog @@ -119,7 +119,7 @@ xiva (0.4.1-3) unstable; urgency=low * Free list allocator was removed due to its poor performance. All production general-purpose allocators I am aware of (tc_malloc, - jemalloc and ptmalloc3) perform faster (boost::fast_pool_allocator + jemalloc and ptmalloc3) perform faster (boost::fast_pool_allocator sucks as well!). * m4 scripts was improved to work on various platforms @@ -135,13 +135,13 @@ xiva (0.4.1-2) unstable; urgency=low xiva (0.4.1-1) unstable; urgency=low * Architecture was changed sufficiently: particurarly, levelization of - physical dependencies was performed as well as many minor changes. + physical dependencies was performed as well as many minor changes. * Python binding was implemented. * Unit tests are implemented now with boost::test instead of cppunit. - * Notifications when connection opens or closes were implemented and + * Notifications when connection opens or closes were implemented and tested. * Node-based STL containers now use single-threaded free-list allocator. @@ -150,7 +150,7 @@ xiva (0.4.1-1) unstable; urgency=low xiva (0.3.1-2) unstable; urgency=low - * Implementation of connection manager was replaced with one based on + * Implementation of connection manager was replaced with one based on boost::multi_index to support multiple connection from one user. * Small refactoring was done to ensure that every translation unit diff --git a/TODO b/TODO index ba69ceb..3d8a798 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Replace std::ostream construction in connection_impl with copying to +* Replace std::ostream construction in connection_impl with copying to streambuf_iterator * Fix http error response to send text representing error as well http diff --git a/autogen.sh b/autogen.sh index 7a9c5ef..c35756a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -584,7 +584,7 @@ else _version="0.0.0" fi $ECHO "Found GNU Automake version $_version" - version_check "$AUTOMAKE_VERSION" "$_version" + version_check "$AUTOMAKE_VERSION" "$_version" if [ $? -ne 0 ] ; then _report_error=yes fi @@ -686,7 +686,7 @@ else _version="0.0.0" fi $ECHO "Found GNU Libtool version $_version" - version_check "$LIBTOOL_VERSION" "$_version" + version_check "$LIBTOOL_VERSION" "$_version" if [ $? -ne 0 ] ; then _report_error=yes fi @@ -1208,7 +1208,7 @@ manual_autogen ( ) { libtoolize_output="`$LIBTOOLIZE $LIBTOOLIZE_OPTIONS 2>&1`" ret=$? $VERBOSE_ECHO "$libtoolize_output" - + if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi else if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then @@ -1216,7 +1216,7 @@ manual_autogen ( ) { libtoolize_output="`$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS 2>&1`" ret=$? $VERBOSE_ECHO "$libtoolize_output" - + if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi fi fi @@ -1264,7 +1264,7 @@ manual_autogen ( ) { macros_to_search="" ac_major="`echo ${AUTOCONF_VERSION}. | cut -d. -f1 | sed 's/[^0-9]//g'`" ac_minor="`echo ${AUTOCONF_VERSION}. | cut -d. -f2 | sed 's/[^0-9]//g'`" - + if [ $ac_major -lt 2 ] ; then macros_to_search="$ac2_59_macros $ac2_55_macros $ac2_54_macros" else @@ -1382,7 +1382,7 @@ EOF automake_output="`$AUTOMAKE $AUTOMAKE_OPTIONS 2>&1`" ret=$? $VERBOSE_ECHO "$automake_output" - + if [ ! $ret = 0 ] ; then ################### @@ -1394,7 +1394,7 @@ EOF automake_output="`$AUTOMAKE $ALT_AUTOMAKE_OPTIONS 2>&1`" ret=$? $VERBOSE_ECHO "$automake_output" - + if [ ! $ret = 0 ] ; then # test if libtool is busted libtool_failure "$automake_output" diff --git a/config/ax_boost_header.m4 b/config/ax_boost_header.m4 index f257d36..8448af8 100644 --- a/config/ax_boost_header.m4 +++ b/config/ax_boost_header.m4 @@ -2,7 +2,7 @@ AC_DEFUN([AX_BOOST_HEADER], [ ax_header_found="yes" AC_REQUIRE([AX_BOOST_PREFIX]) - + ax_boost_header_stored_cppflags="$CPPFLAGS" CPPFLAGS="$ax_boost_header_stored_cppflags $BOOST_CPPFLAGS" AC_CHECK_HEADER([boost/$1], [], [ax_header_found="no"]) @@ -10,6 +10,6 @@ AC_DEFUN([AX_BOOST_HEADER], if test "f$ax_header_found" = "fyes"; then ifelse([$2], , :, [$2]) else - ifelse([$3], , :, [$3]) + ifelse([$3], , :, [$3]) fi ]) diff --git a/config/ax_boost_multi_index.m4 b/config/ax_boost_multi_index.m4 index c2e5894..a7eeb33 100644 --- a/config/ax_boost_multi_index.m4 +++ b/config/ax_boost_multi_index.m4 @@ -3,7 +3,7 @@ AC_DEFUN([AX_BOOST_MULTI_INDEX], ax_boost_multi_index_stored_cppflags="$CPPFLAGS" AC_REQUIRE([AX_BOOST_PREFIX]) CPPFLAGS="$ax_boost_multi_index_stored_cppflags $BOOST_CPPFLAGS -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION" - + ax_have_boost_multi_index="yes" AX_BOOST_HEADER([multi_index_container.hpp], [], [ax_have_boost_multi_index="no"]) AX_BOOST_HEADER([multi_index/hashed_index.hpp], [], [ax_have_boost_multi_index="no"]) @@ -13,5 +13,5 @@ AC_DEFUN([AX_BOOST_MULTI_INDEX], ifelse([$1], , :, [$1]) else ifelse([$2], , :, [$2]) - fi + fi ]) diff --git a/config/ax_boost_prefix.m4 b/config/ax_boost_prefix.m4 index 82f32cc..c51409c 100644 --- a/config/ax_boost_prefix.m4 +++ b/config/ax_boost_prefix.m4 @@ -20,7 +20,7 @@ AC_DEFUN([_AX_CHECK_BOOST_IN], AC_DEFUN([AX_BOOST_PREFIX], [ ax_boost_prefix="" - AC_ARG_WITH([boost-prefix], + AC_ARG_WITH([boost-prefix], AS_HELP_STRING(--with-boost-prefix, specifies boost installation), [ if test "f$withval" != "f"; then @@ -34,7 +34,7 @@ AC_DEFUN([AX_BOOST_PREFIX], _AX_CHECK_BOOST_IN([$i], [ax_boost_prefix="$i"], []) done; fi - + if test "f$ax_boost_prefix" != "f"; then AC_SUBST([BOOST_LDFLAGS], ["-I$ax_boost_prefix/lib"]) AC_SUBST([BOOST_CPPFLAGS], ["-I$ax_boost_prefix/include"]) diff --git a/config/ax_boost_python.m4 b/config/ax_boost_python.m4 index cc1ff3c..ae5ecae 100644 --- a/config/ax_boost_python.m4 +++ b/config/ax_boost_python.m4 @@ -2,30 +2,30 @@ AC_DEFUN([AX_BOOST_PYTHON], [ ax_boost_python_stored_ldflags="$LDFLAGS" ax_boost_python_stored_cppflags="$CPPFLAGS" - + AC_REQUIRE([AX_BOOST_PREFIX]) AC_REQUIRE([AX_PYTHON_DEVEL]) AX_BOOST_LIB([ax_boost_python_lib], [boost_python]) - + CPPFLAGS="$ax_boost_python_stored_cppflags $PYTHON_CPPFLAGS" LDFLAGS="$ax_boost_python_stored_ldflags $BOOST_LDFLAGS -l$ax_boost_python_lib $PYTHON_LDFLAGS" ax_have_boost_python="yes" AX_BOOST_HEADER([python.hpp], [], [ax_have_boost_python="no"]) - + AC_MSG_CHECKING([trying to link with boost::python]) AC_LINK_IFELSE( [ AC_LANG_PROGRAM([#include ], [boost::python::str s;]) ], - [ AC_MSG_RESULT(yes) ], + [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no); ax_have_boost_python="no" ]) - + CPPFLAGS="$ax_boost_python_stored_cppflags" LDFLAGS="$ax_boost_python_stored_ldflags" - + if test "f$ax_have_boost_python" = "fyes"; then ifelse([$1], , :, [$1]) AC_SUBST([BOOST_PYTHON_LDFLAGS], ["-l$ax_boost_python_lib"]) else ifelse([$2], , :, [$2]) - fi + fi ]) diff --git a/config/ax_boost_required.m4 b/config/ax_boost_required.m4 index 6b34fa5..08f545e 100644 --- a/config/ax_boost_required.m4 +++ b/config/ax_boost_required.m4 @@ -2,12 +2,12 @@ AC_DEFUN([AX_BOOST_REQUIRED], [ ax_header_found="yes" AC_REQUIRE([AX_BOOST_PREFIX]) - + ax_boost_requeired_stored_cppflags="$CPPFLAGS" CPPFLAGS="$ax_boost_requeired_stored_cppflags $BOOST_CPPFLAGS" AC_CHECK_HEADER([boost/$1], [], [ax_header_found="no"]) CPPFLAGS="$ax_boost_requeired_stored_cppflags" - + if test "f$ax_header_found" != "fyes"; then AC_MSG_ERROR([required header boost/$1 is not found in $ax_boost_prefix/include]) fi diff --git a/config/ax_boost_system.m4 b/config/ax_boost_system.m4 index 45d0f5f..174dcbe 100644 --- a/config/ax_boost_system.m4 +++ b/config/ax_boost_system.m4 @@ -1,27 +1,27 @@ AC_DEFUN([AX_BOOST_SYSTEM], [ ax_boost_system_stored_ldflags="$LDFLAGS" - + AC_REQUIRE([AX_BOOST_PREFIX]) AX_BOOST_LIB([ax_boost_system_lib], [boost_system]) - + LDFLAGS="$ax_boost_regex_stored_ldflags $BOOST_LDFLAGS -l$ax_boost_system_lib" - + ax_have_boost_system="yes" AX_BOOST_HEADER([system/config.hpp], [], [ax_have_boost_system="no"]) - + AC_MSG_CHECKING([trying to link with boost::system]) AC_LINK_IFELSE( [ AC_LANG_PROGRAM([#include ], [boost::system::error_code code;]) ], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no); ax_have_boost_system="no" ]) - + LDFLAGS="$ax_boost_system_stored_ldflags" - + if test "f$ax_have_boost_system" = "fyes"; then ifelse([$1], , :, [$1]) AC_SUBST([BOOST_SYSTEM_LDFLAGS], ["-l$ax_boost_system_lib"]) else ifelse([$2], , :, [$2]) - fi + fi ]) diff --git a/config/ax_boost_thread.m4 b/config/ax_boost_thread.m4 index 4cfed3a..a698cb2 100644 --- a/config/ax_boost_thread.m4 +++ b/config/ax_boost_thread.m4 @@ -1,30 +1,30 @@ AC_DEFUN([AX_BOOST_THREAD], [ ax_boost_thread_stored_ldflags="$LDFLAGS" - + AC_REQUIRE([AX_BOOST_PREFIX]) AX_BOOST_LIB([ax_boost_thread_lib], [boost_thread]) - + LDFLAGS="$ax_boost_thread_stored_ldflags $BOOST_LDFLAGS -l$ax_boost_thread_lib" - + ax_have_boost_thread="yes" AX_BOOST_HEADER([thread.hpp], [], [ax_have_boost_thread="no"]) AX_BOOST_HEADER([thread/mutex.hpp], [], [ax_have_boost_thread="no"]) AX_BOOST_HEADER([thread/condition.hpp], [], [ax_have_boost_thread="no"]) AX_BOOST_HEADER([thread/thread.hpp], [], [ax_have_boost_thread="no"]) - + AC_MSG_CHECKING([trying to link with boost::thread]) AC_LINK_IFELSE( [ AC_LANG_PROGRAM([#include ], [boost::thread_group g;]) ], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no); ax_have_boost_thread="no" ]) - + LDFLAGS="$ax_boost_thread_stored_ldflags" - + if test "f$ax_have_boost_thread" = "fyes"; then ifelse([$1], , :, [$1]) AC_SUBST([BOOST_THREAD_LDFLAGS], ["-l$ax_boost_thread_lib"]) else ifelse([$2], , :, [$2]) - fi + fi ]) diff --git a/config/ax_boost_unit_test.m4 b/config/ax_boost_unit_test.m4 index f1afdd4..ac599bd 100644 --- a/config/ax_boost_unit_test.m4 +++ b/config/ax_boost_unit_test.m4 @@ -1,28 +1,28 @@ AC_DEFUN([AX_BOOST_UNIT_TEST], [ ax_boost_unit_test_stored_ldflags="$LDFLAGS" - + AC_REQUIRE([AX_BOOST_PREFIX]) AX_BOOST_LIB([ax_boost_unit_test_lib], [boost_unit_test_framework]) - + LDFLAGS="$ax_boost_unit_test_stored_ldflags $BOOST_LDFLAGS -l$ax_boost_unit_test_lib" - + ax_have_boost_unit_test="yes" AX_BOOST_HEADER([test/unit_test.hpp], [], [ax_have_boost_unit_test="no"]) AX_BOOST_HEADER([test/test_case_template.hpp], [], [ax_have_boost_unit_test="no"]) - + AC_MSG_CHECKING([trying to link with boost::test]) AC_LINK_IFELSE( [ AC_LANG_PROGRAM([#include ], []) ], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no); ax_have_boost_unit_test="no" ]) - + LDFLAGS="$ax_boost_unit_test_stored_ldflags" - + if test "f$ax_have_boost_unit_test" = "fyes"; then ifelse([$1], , :, [$1]) AC_SUBST([BOOST_UNIT_TEST_LDFLAGS], ["-l$ax_boost_unit_test_lib"]) else ifelse([$2], , :, [$2]) - fi + fi ]) diff --git a/config/libxml2.m4 b/config/libxml2.m4 index 68cd824..50d1da7 100644 --- a/config/libxml2.m4 +++ b/config/libxml2.m4 @@ -9,7 +9,7 @@ dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS dnl -AC_DEFUN([AM_PATH_XML2],[ +AC_DEFUN([AM_PATH_XML2],[ AC_ARG_WITH(xml-prefix, [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)], xml_config_prefix="$withval", xml_config_prefix="") @@ -64,7 +64,7 @@ dnl #include #include -int +int main() { int xml_major_version, xml_minor_version, xml_micro_version; @@ -100,9 +100,9 @@ main() printf("*** xml2-config (version %d.%d.%d)\n", $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version); return 1; - } + } /* Compare the headers to the library to make sure we match */ - /* Less than ideal -- doesn't provide us with return value feedback, + /* Less than ideal -- doesn't provide us with return value feedback, * only exits if there's a serious mismatch between header and library. */ LIBXML_TEST_VERSION; @@ -141,7 +141,7 @@ main() if test "x$no_xml" = x ; then AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)) - ifelse([$2], , :, [$2]) + ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$XML2_CONFIG" = "no" ; then diff --git a/configure.in b/configure.in index 4c98418..5265b92 100644 --- a/configure.in +++ b/configure.in @@ -76,8 +76,8 @@ AC_SUBST(LIBLTDL) AC_CHECK_LIB([ssl], [main]) -AC_CONFIG_FILES([Makefile include/Makefile include/xiva/Makefile - include/details/Makefile library/Makefile stdext/Makefile +AC_CONFIG_FILES([Makefile include/Makefile include/xiva/Makefile + include/details/Makefile library/Makefile stdext/Makefile daemon/Makefile python/Makefile tests/Makefile utils/Makefile]) AC_OUTPUT diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 5264daa..7f7e1ba 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -5,7 +5,7 @@ libxiva_daemon_la_SOURCES = command_line.cpp xml.cpp xml_settings.cpp \ variable_map.cpp sbin_PROGRAMS = xiva-daemon -xiva_daemon_SOURCES = main.cpp +xiva_daemon_SOURCES = main.cpp xiva_daemon_LDADD = libxiva-daemon.la ${top_srcdir}/library/libxiva-loader.la AM_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/config \ diff --git a/debian/changelog b/debian/changelog index 4f70dd2..1bce678 100644 --- a/debian/changelog +++ b/debian/changelog @@ -63,19 +63,19 @@ xiva (1.6.1-1) unstable; urgency=low * drop unused param formatter from message_filter * removed dead lock on stop python server * fixed bug: insert connection into manager - after initialization formatters and channels + after initialization formatters and channels -- ponomarev Mon, 17 Jan 2011 16:22:39 +0300 xiva (1.5.7-3) unstable; urgency=low - * send http status-line if web-socket handshake was failed + * send http status-line if web-socket handshake was failed -- ponomarev Wed, 12 Jan 2011 14:56:46 +0300 xiva (1.5.7-2) unstable; urgency=low - * process failures directly to connection_manager throught strand + * process failures directly to connection_manager throught strand * do not dispatch event for finished message queue -- ponomarev Mon, 27 Dec 2010 20:10:09 +0300 @@ -97,7 +97,7 @@ xiva (1.5.6-1) unstable; urgency=low * try finishing connections after stop() in threaded_handler_invoker * skip pushing messages after stop() * fixed python crashes (dec references of formatters on enabled gil) - * bulk operations in python logger + * bulk operations in python logger -- ponomarev Wed, 22 Dec 2010 17:35:56 +0300 @@ -140,7 +140,7 @@ xiva (1.5.2-2) unstable; urgency=low xiva (1.5.2-1) unstable; urgency=low * process notify_connection_closed in reverse order - * don't throw exception from compound_listener::notify_connection_closed() + * don't throw exception from compound_listener::notify_connection_closed() * pass notify_close=true flag from public server to connection_manager while processing failure * suppress info log messages when operation aborted @@ -313,7 +313,7 @@ xiva (0.10.3-2) unstable; urgency=low xiva (0.10.3-1) unstable; urgency=low - * fixed python binding + * fixed python binding -- ponomarev Tue, 27 Apr 2010 16:55:21 +0400 @@ -373,7 +373,7 @@ xiva (0.9.2-0) unstable; urgency=low xiva (0.9.1-1) unstable; urgency=low - * reincarnate connection_id to listener interface + * reincarnate connection_id to listener interface -- ponomarev Fri, 02 Apr 2010 19:04:39 +0400 @@ -385,7 +385,7 @@ xiva (0.9.1-0) unstable; urgency=low xiva (0.8.1-1) unstable; urgency=low - * name() methods moved to connection_base + * name() methods moved to connection_base -- ponomarev Tue, 30 Mar 2010 15:27:21 +0400 @@ -422,7 +422,7 @@ xiva (0.7.1) unstable; urgency=low xiva (0.6.3-1) unstable; urgency=low - * remove logger from connection_impl + * remove logger from connection_impl -- ponomarev Wed, 24 Mar 2010 16:08:23 +0300 @@ -572,7 +572,7 @@ xiva (0.4.1-3) unstable; urgency=low * Free list allocator was removed due to its poor performance. All production general-purpose allocators I am aware of (tc_malloc, - jemalloc and ptmalloc3) perform faster (boost::fast_pool_allocator + jemalloc and ptmalloc3) perform faster (boost::fast_pool_allocator sucks as well!). * m4 scripts was improved to work on various platforms @@ -588,13 +588,13 @@ xiva (0.4.1-2) unstable; urgency=low xiva (0.4.1-1) unstable; urgency=low * Architecture was changed sufficiently: particurarly, levelization of - physical dependencies was performed as well as many minor changes. + physical dependencies was performed as well as many minor changes. * Python binding was implemented. * Unit tests are implemented now with boost::test instead of cppunit. - * Notifications when connection opens or closes were implemented and + * Notifications when connection opens or closes were implemented and tested. * Node-based STL containers now use single-threaded free-list allocator. @@ -603,7 +603,7 @@ xiva (0.4.1-1) unstable; urgency=low xiva (0.3.1-2) unstable; urgency=low - * Implementation of connection manager was replaced with one based on + * Implementation of connection manager was replaced with one based on boost::multi_index to support multiple connection from one user. * Small refactoring was done to ensure that every translation unit diff --git a/debian/rules b/debian/rules index d82176c..a194b49 100755 --- a/debian/rules +++ b/debian/rules @@ -37,7 +37,7 @@ configure-stamp: autogen-stamp build: build-stamp -build-stamp: configure-stamp +build-stamp: configure-stamp dh_testdir $(MAKE) release=1 $(MAKE) check @@ -48,7 +48,7 @@ clean: dh_testroot rm -f configure-stamp build-stamp -$(MAKE) distclean - dh_clean + dh_clean tests: build dh_testdir @@ -57,7 +57,7 @@ tests: build install: build tests dh_testdir dh_testroot - dh_clean -k + dh_clean -k dh_installdirs $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp @@ -65,7 +65,7 @@ binary-arch: build install dh_testdir dh_testroot dh_movefiles - dh_installchangelogs + dh_installchangelogs dh_installinit --no-start dh_link # dh_strip diff --git a/doxyfile b/doxyfile index 9beb39d..dd5f776 100644 --- a/doxyfile +++ b/doxyfile @@ -573,7 +573,7 @@ INPUT_ENCODING = UTF-8 # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 -FILE_PATTERNS = +FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. @@ -620,7 +620,7 @@ EXAMPLE_PATH = examples stdext # and *.h) to filter out the source-files in the directories. If left # blank all files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude diff --git a/examples/xiva-daemon-fastcgi-perl/debian/xiva-daemon-fastcgi-perl.init b/examples/xiva-daemon-fastcgi-perl/debian/xiva-daemon-fastcgi-perl.init index 05dc9bd..97fa168 100644 --- a/examples/xiva-daemon-fastcgi-perl/debian/xiva-daemon-fastcgi-perl.init +++ b/examples/xiva-daemon-fastcgi-perl/debian/xiva-daemon-fastcgi-perl.init @@ -24,7 +24,7 @@ case "$1" in mkdir -p $LOG_DIR chown $XIVA_FCGI_USER $PID_DIR chown $XIVA_FCGI_USER $LOG_DIR - + echo "Starting $THIS:" if /sbin/start-stop-daemon --quiet --stop --signal 0 --pidfile $XIVA_FCGI_DAEMON_PID 2>/dev/null 1>/dev/null then @@ -53,7 +53,7 @@ case "$1" in fi exit fi - + #Kill daemon /sbin/start-stop-daemon --quiet --stop --signal 0 --pidfile $XIVA_FCGI_DAEMON_PID 2>&1 >/dev/null /sbin/start-stop-daemon --quiet --signal 15 --stop --pidfile $XIVA_FCGI_DAEMON_PID 2>&1 >/dev/null @@ -71,7 +71,7 @@ case "$1" in exit 1 fi done - + #Rm pid file rm -f $XIVA_FCGI_DAEMON_PID ;; diff --git a/examples/xiva-daemon-python-configs/debian/xiva-daemon-python-configs.preinst b/examples/xiva-daemon-python-configs/debian/xiva-daemon-python-configs.preinst index 1012883..3b4d9ed 100644 --- a/examples/xiva-daemon-python-configs/debian/xiva-daemon-python-configs.preinst +++ b/examples/xiva-daemon-python-configs/debian/xiva-daemon-python-configs.preinst @@ -6,5 +6,5 @@ USER=www-data mkdir -p $WWW_DIR $RUN_DIR -chown $USER $WWW_DIR $WWW_DIR +chown $USER $WWW_DIR $WWW_DIR chgrp $USER $WWW_DIR $WWW_DIR diff --git a/examples/xiva-daemon-python/debian/changelog b/examples/xiva-daemon-python/debian/changelog index ef9afa8..91d6292 100644 --- a/examples/xiva-daemon-python/debian/changelog +++ b/examples/xiva-daemon-python/debian/changelog @@ -52,7 +52,7 @@ xiva-daemon-python (1.4.1-1) unstable; urgency=low xiva-daemon-python (1.3.3-2) unstable; urgency=low - * fixed Usage message + * fixed Usage message -- ponomarev Tue, 02 Nov 2010 13:30:56 +0300 diff --git a/examples/xiva-daemon-python/debian/xiva-daemon-python.init b/examples/xiva-daemon-python/debian/xiva-daemon-python.init index 4f9a2d0..b947ff0 100644 --- a/examples/xiva-daemon-python/debian/xiva-daemon-python.init +++ b/examples/xiva-daemon-python/debian/xiva-daemon-python.init @@ -26,7 +26,7 @@ case "$1" in mkdir -p $LOG_DIR chown $XIVA_USER $PID_DIR chown $XIVA_USER $LOG_DIR - + echo "Starting xiva:" if /sbin/start-stop-daemon --quiet --stop --signal 0 --pidfile $XIVA_DAEMON_PID 2>/dev/null 1>/dev/null then @@ -66,7 +66,7 @@ case "$1" in fi exit fi - + #Kill fastcgistart /sbin/start-stop-daemon --quiet --stop --signal 0 --pidfile $XIVA_STARTER_PID 2>&1 >/dev/null /sbin/start-stop-daemon --quiet --signal 15 --stop --pidfile $XIVA_STARTER_PID 2>&1 >/dev/null @@ -88,7 +88,7 @@ case "$1" in exit 1 fi done - + #Rm pid files rm -f $XIVA_DAEMON_PID rm -f $XIVA_STARTER_PID diff --git a/examples/xiva-daemon-python/debian/xiva-daemon-python.preinst b/examples/xiva-daemon-python/debian/xiva-daemon-python.preinst index 7d49d26..c29b3c6 100644 --- a/examples/xiva-daemon-python/debian/xiva-daemon-python.preinst +++ b/examples/xiva-daemon-python/debian/xiva-daemon-python.preinst @@ -7,7 +7,7 @@ USER=www-data mkdir -p $LOG_DIR $RUN_DIR -chown $USER $LOG_DIR $RUN_DIR +chown $USER $LOG_DIR $RUN_DIR chgrp $USER $LOG_DIR $RUN_DIR diff --git a/examples/xiva-web-chat-lighttpd-config/debian/postinst b/examples/xiva-web-chat-lighttpd-config/debian/postinst index 3010a88..dd03f86 100644 --- a/examples/xiva-web-chat-lighttpd-config/debian/postinst +++ b/examples/xiva-web-chat-lighttpd-config/debian/postinst @@ -8,13 +8,13 @@ case $1 in echo "WARN: lighttpd config is not valid" fi ;; - + abort-upgrade|abort-remove|abort-deconfigure) ;; - + *) echo "postinst called with unknown argument '$1'" >&2 ;; esac - + # vim: set ts=4 sw=4 et: diff --git a/examples/xiva-web-chat-lighttpd-config/debian/rules b/examples/xiva-web-chat-lighttpd-config/debian/rules index 914ca1a..e49d096 100755 --- a/examples/xiva-web-chat-lighttpd-config/debian/rules +++ b/examples/xiva-web-chat-lighttpd-config/debian/rules @@ -1,6 +1,6 @@ #!/usr/bin/make -f -build: +build: # Nothing to do install: @@ -24,5 +24,5 @@ binary-arch: build install binary: binary-indep binary-arch -clean: +clean: dh_clean diff --git a/examples/xiva-web-chat/blocks/b-message/b-message.css b/examples/xiva-web-chat/blocks/b-message/b-message.css index 7242e5c..7d71f95 100644 --- a/examples/xiva-web-chat/blocks/b-message/b-message.css +++ b/examples/xiva-web-chat/blocks/b-message/b-message.css @@ -5,7 +5,7 @@ .b-message .b-message__head { overflow: auto; padding: 3px; - + font-size: 80%; background: #FEF; diff --git a/examples/xiva-web-chat/blocks/b-message/b-message.ie.css b/examples/xiva-web-chat/blocks/b-message/b-message.ie.css index 6127a6d..5e60a0e 100644 --- a/examples/xiva-web-chat/blocks/b-message/b-message.ie.css +++ b/examples/xiva-web-chat/blocks/b-message/b-message.ie.css @@ -1,6 +1,6 @@ .b-message .b-message__head { height: 15px; - + font-size: 85%; } diff --git a/examples/xiva-web-chat/blocks/g-reset/g-reset.css b/examples/xiva-web-chat/blocks/g-reset/g-reset.css index aada1ba..80c5162 100644 --- a/examples/xiva-web-chat/blocks/g-reset/g-reset.css +++ b/examples/xiva-web-chat/blocks/g-reset/g-reset.css @@ -10,7 +10,7 @@ h1 { position: relative; left: -10px; width: 800px; - + margin: .5em 0; padding: 2px 10px; diff --git a/examples/xiva-web-chat/debian/changelog b/examples/xiva-web-chat/debian/changelog index d12d01f..ac231a8 100644 --- a/examples/xiva-web-chat/debian/changelog +++ b/examples/xiva-web-chat/debian/changelog @@ -13,6 +13,6 @@ xiva-web-chat (1.0) unstable; urgency=low xiva-web-chat (0.1) unstable; urgency=low - * Initial Release + * Initial Release -- Leonid Khachaturov Thu, 30 Sep 2010 20:42:21 +0400 diff --git a/examples/xiva-web-chat/debian/rules b/examples/xiva-web-chat/debian/rules index 49844e7..4f453f1 100755 --- a/examples/xiva-web-chat/debian/rules +++ b/examples/xiva-web-chat/debian/rules @@ -11,7 +11,7 @@ configure-stamp: build: build-stamp -build-stamp: configure-stamp +build-stamp: configure-stamp dh_testdir touch $@ @@ -19,7 +19,7 @@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp - dh_clean + dh_clean install/xiva-web-chat:: mkdir -p $(DEBDIR) @@ -28,7 +28,7 @@ install/xiva-web-chat:: find $(DEBDIR) -name '*-stamp' | xargs rm -Rf find $(DEBDIR) -name .gitignore | xargs rm -f rm -Rf $(DEBDIR)/web-socket-js/flash-src - + binary-indep: build install binary-arch: build install install/xiva-web-chat diff --git a/examples/xiva-web-chat/index.html b/examples/xiva-web-chat/index.html index f3be806..32f9c7c 100644 --- a/examples/xiva-web-chat/index.html +++ b/examples/xiva-web-chat/index.html @@ -3,7 +3,7 @@ A simple chat that uses Xiva - + @@ -47,7 +47,7 @@

Xiva Chatroom

- + diff --git a/examples/xiva-web-chat/index.js b/examples/xiva-web-chat/index.js index d92ab7e..0b4e005 100644 --- a/examples/xiva-web-chat/index.js +++ b/examples/xiva-web-chat/index.js @@ -1,6 +1,6 @@ $(document).ready(function() { var inited = false; - + // Blocks var bLogin = $('.b-login'); var bUserList = $('.b-userlist'); @@ -17,7 +17,7 @@ $(document).ready(function() { var userLinks = $('a.b-userlist__user', bUserList); var roomLinks = $('.b-rooms__room a', bRooms); var messageArea = $('.b-writemessage__area', bMessageArea); - + var usernames = {}; var currentName, currentRoom; @@ -38,15 +38,15 @@ $(document).ready(function() { transport.initSocket(); }(transport), 1000); }; - + var transport = new Xiva.Transport(onopen, onmessage, onclose); - + transport.initSocket(); // UI loginButton.click(login); loginForm.submit(login); - + var createTextareaListener = function() { messageArea = $('.b-writemessage__area', bMessageArea); @@ -70,7 +70,7 @@ $(document).ready(function() { } }); }; - + createTextareaListener(); userLinks.live('click', function(e) { var target = $(this); @@ -83,25 +83,25 @@ $(document).ready(function() { roomLinks.live('click', function(e) { var newRoom = this.id; - + $('#messages_' + currentRoom).addClass('g-hidden'); $('#messages_' + newRoom).removeClass('g-hidden'); - + var currentRoomLink = $('#' + currentRoom); var newRoomLink = $('#' + newRoom); var currentRoomElement = currentRoomLink.parent(); var newRoomElement = newRoomLink.parent(); - + var currentRoomLabel = currentRoomLink.html(); var newRoomLabel = newRoomLink.html(); - + currentRoomElement.removeClass('b-rooms__room_active'); newRoomElement.addClass('b-rooms__room_active'); - + currentRoomElement.html('' + currentRoomLabel + ''); newRoomElement.html('' + newRoomLabel + ''); - + $('header h1').html('Xiva Chatroom — ' + newRoomLabel); // Switch rooms @@ -112,13 +112,13 @@ $(document).ready(function() { return false; }); - + function login(e) { if (inited === false) return false; var loginName = $('#username'); var loginRoom = $('#roomname :selected'); - + var loginFieldContainer = loginName.parent(); var loginErrorContainer = loginFieldContainer.find('.b-login__field__error'); @@ -137,34 +137,34 @@ $(document).ready(function() { currentName = transport.escapeHTML(loginName.val()); currentRoom = loginRoom.attr('name'); - - // Show chat window + + // Show chat window bChatLogin.addClass('g-hidden'); bChatChat.removeClass('g-hidden').slideDown(1000, function() { $(this).height('auto'); }); - + // Show current chat room $('#messages_' + currentRoom).removeClass('g-hidden'); $('header h1').html('Xiva Chatroom — ' + $('#' + currentRoom).html()); - + // Make chosen room active var roomElement = $('#' + currentRoom).parent(); - + roomElement.addClass('b-rooms__room_active'); roomElement.html('' + loginRoom.parent().val() + ''); - + // Append user to the userlist bUserList.removeClass('g-hidden'); // Send 'login' event postMessage("login", {}); - + messageArea.focus(); return false; } - + function postMessage(type, params) { var messageObj = { username: transport.encodeMessage(currentName), @@ -173,15 +173,15 @@ $(document).ready(function() { text: (type == "message") ? transport.encodeMessage(messageArea.val()) : '', params: params }; - + var message = 'cmd=' + 'msg chat/room_1 ' + JSON.stringify(messageObj); - + transport.postMessage(message); } function receiveMessage(messageObj) { if (messageObj === "ping\n") return; - + messageObj = JSON.parse(messageObj); var username = transport.decodeMessage(messageObj.username), @@ -199,23 +199,23 @@ $(document).ready(function() { '' + '
' + transport.escapeHTML(text) + '
' + ''); - + if (username == currentName) { message.addClass('b-message_you'); } - + // Add message to the room it was sent to $('#messages_' + room).append(message); // Animate new message message.animate({ opacity: 1 }, 1000); bMessages.scrollTop(bMessages.attr("scrollHeight")); - + // Update unread count if the user is not in the current room if (room != currentRoom) { var roomElement = $('#' + room).parent(); var roomUnread = roomElement.find('.b-rooms__room__unread'); - + if (roomUnread.length > 0) { roomUnread.html(parseInt(roomUnread.html(), 10) + 1); } else { @@ -269,7 +269,7 @@ $(document).ready(function() { username = $.trim(username); if (username == '') return false; - + var isDuplicate = false; for (var i in usernames) { @@ -297,7 +297,7 @@ $(document).ready(function() { } return a; } - + function formatDate(date) { return date.getDate() + '.' + date.getMonth() + '.' + date.getFullYear() + ' ' + date.getHours() + ':' + date.getMinutes(); } diff --git a/examples/xiva-web-chat/transport.js b/examples/xiva-web-chat/transport.js index 9f5e283..56d8861 100644 --- a/examples/xiva-web-chat/transport.js +++ b/examples/xiva-web-chat/transport.js @@ -2,16 +2,16 @@ var Xiva = {}; Xiva.Transport = function(onopen, onmessage, onclose) { this.ws = null; - + // this.ws_url = window.location.hostname.toString() + ':8881/?id=chat'; this.ws_url = 'xiva.opensource.yandex.net/?id=chat'; - + this.onopen = onopen; this.onmessage = onmessage; this.onclose = onclose; - + this.connectionError = 0; - + window.WEB_SOCKET_SWF_LOCATION = "web-socket-js/WebSocketMain.swf"; window.WEB_SOCKET_DEBUG = true; }; @@ -26,7 +26,7 @@ Xiva.Transport.prototype = { this.onopen(); } }, - + initWSTransport: function() { // Connect to Web Socket. // Change host/port here to your own Web Socket server. @@ -37,10 +37,10 @@ Xiva.Transport.prototype = { this.ws.onmessage = this.onmessage; this.ws.onclose = this.onclose; }, - + initXHRTransport: function() { var self = this; - + // A very simple JSON-P transport. Won't care about message ordering, stalled connections, or whatever. $.ajax({ url: 'http://' + this.ws_url + '&single', @@ -63,7 +63,7 @@ Xiva.Transport.prototype = { } }); }, - + postMessage: function(message) { $.ajax({ type: 'POST', @@ -71,7 +71,7 @@ Xiva.Transport.prototype = { data: message }); }, - + // Encodes a string into a sequence of \uXXXX codes encodeMessage: function(str) { var encodedStr = ''; @@ -83,7 +83,7 @@ Xiva.Transport.prototype = { return chr; } - + for (var i=0; i - is released under the MIT License +/* SWFObject v2.2 + is released under the MIT License */ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab allocator_type; typedef asio::basic_streambuf streambuf_type; @@ -158,7 +158,7 @@ connection_impl::start() { asio::ip::address addr = endpoint.address(); addr_ = addr.to_string(); handshake(); - } + } catch (std::exception const &e) { handle_exception(e); } @@ -287,18 +287,18 @@ connection_impl::handle_read_request(syst::error_code const &c if (sz < static_cast(policy_file_request_ascz_size) || !std::equal(policy_str, policy_str + policy_file_request_ascz_size, begin, ci_equal())) { - + throw std::runtime_error("invalid policy request"); } is_policy_ = true; write_policy_data(); - } + } else { parsing_request = true; request_impl req(begin, end); connection_base_type::init(req, ct_.secure()); parsing_request = false; - + response_impl resp; boost::intrusive_ptr self(this); ct_.handler_invoker().invoke_handler(self, req, resp); @@ -440,7 +440,7 @@ connection_impl::read_request() { try { connection_impl_ptr_type self(this); - asio::async_read_until(socket().native_sock(), *in_, request_checker(data_.max_request_size()), + asio::async_read_until(socket().native_sock(), *in_, request_checker(data_.max_request_size()), boost::bind(&type::handle_read_request, self, asio::placeholders::error)); setup_timeout(data_.read_timeout()); } diff --git a/include/details/connection_manager_base.hpp b/include/details/connection_manager_base.hpp index 572e777..5b2eb40 100644 --- a/include/details/connection_manager_base.hpp +++ b/include/details/connection_manager_base.hpp @@ -55,7 +55,7 @@ class connection_manager_base : public shared { boost::shared_ptr const& init_channels_stat(); -protected: +protected: message_filter const* msg_filter() const; void fire_connection_opened(connection_base const &conn); diff --git a/include/details/connection_traits.hpp b/include/details/connection_traits.hpp index 1f7e545..8954264 100644 --- a/include/details/connection_traits.hpp +++ b/include/details/connection_traits.hpp @@ -40,7 +40,7 @@ class connection_traits : public connection_traits_base { typedef connection_manager connection_manager_type; typedef boost::intrusive_ptr handler_invoker_ptr_type; typedef boost::intrusive_ptr connection_manager_ptr_type; - + connection_traits(connection_manager_ptr_type cm, handler_invoker_ptr_type cv); virtual ~connection_traits(); @@ -49,7 +49,7 @@ class connection_traits : public connection_traits_base { HandlerInvoker& handler_invoker(); connection_manager_type& manager(); - + private: connection_traits(connection_traits const &); connection_traits& operator = (connection_traits const &); diff --git a/include/details/functors.hpp b/include/details/functors.hpp index 54745a5..a3110b0 100644 --- a/include/details/functors.hpp +++ b/include/details/functors.hpp @@ -99,7 +99,7 @@ is_ci_equal(R1 const &var, R2 const &target) { //BOOST_STATIC_ASSERT((boost::is_same::value)); BOOST_STATIC_ASSERT((sizeof(typename R1::value_type) == sizeof(typename R2::value_type))); if (var.size() == target.size()) { - return std::equal(var.begin(), var.end(), target.begin(), + return std::equal(var.begin(), var.end(), target.begin(), ci_equal()); } return false; diff --git a/include/details/line_reader.hpp b/include/details/line_reader.hpp index 69d4161..c8234e3 100644 --- a/include/details/line_reader.hpp +++ b/include/details/line_reader.hpp @@ -51,7 +51,7 @@ class line_reader : private iterator_checker { template inline line_reader::line_reader(Iter begin, Iter end) : - begin_(begin), end_(end), multiline_(false) + begin_(begin), end_(end), multiline_(false) { } diff --git a/include/details/range.hpp b/include/details/range.hpp index 2728087..9a09124 100644 --- a/include/details/range.hpp +++ b/include/details/range.hpp @@ -95,7 +95,7 @@ class range : public range_base::itera template inline range_base::range_base() : - begin_(), end_() + begin_(), end_() { } @@ -148,7 +148,7 @@ range_base::range_base() : template inline range_base::range_base(Iter begin, Iter end) : - range_base(begin, end) + range_base(begin, end) { } @@ -174,13 +174,13 @@ range_base::rbegin() const { template inline range_base::range_base() : - range_base() + range_base() { } template inline range_base::range_base(Iter begin, Iter end) : - range_base(begin, end) + range_base(begin, end) { } @@ -196,7 +196,7 @@ range_base::operator [] (typename range_b template inline range::range() : - range_base::iterator_category>() + range_base::iterator_category>() { } diff --git a/include/details/request_helper.hpp b/include/details/request_helper.hpp index 4153192..c271b69 100644 --- a/include/details/request_helper.hpp +++ b/include/details/request_helper.hpp @@ -89,7 +89,7 @@ struct request_helper { check_read_body_ahead(range const &line) { typedef typename std::iterator_traits::value_type char_type; - + enum { SEC_WEBSOCKET_BODY_SIZE = 8 }; range head, tail; diff --git a/include/details/request_impl.hpp b/include/details/request_impl.hpp index 9de421b..61aa1c8 100644 --- a/include/details/request_impl.hpp +++ b/include/details/request_impl.hpp @@ -40,7 +40,7 @@ class request_impl { request_impl(); template request_impl(Iter begin, Iter end); virtual ~request_impl(); - + std::string const& uri() const; std::string const& body() const; diff --git a/include/details/resource.hpp b/include/details/resource.hpp index 028f2d9..b101973 100644 --- a/include/details/resource.hpp +++ b/include/details/resource.hpp @@ -69,7 +69,7 @@ pointer_access::operator -> () const { template inline resource::resource() : - value_(Traits::default_value()), traits_() + value_(Traits::default_value()), traits_() { } diff --git a/include/details/ssl_connection_socket.hpp b/include/details/ssl_connection_socket.hpp index 53820d7..91e54d4 100644 --- a/include/details/ssl_connection_socket.hpp +++ b/include/details/ssl_connection_socket.hpp @@ -66,7 +66,7 @@ ssl_connection_socket::close() { socket_.lowest_layer().shutdown(asio::ip::tcp::socket::shutdown_both, code); socket_.lowest_layer().close(); } - + }} // namespaces #endif // XIVA_DETAILS_SSL_CONNECTION_SOCKET_HPP_INCLUDED diff --git a/include/details/threaded_handler_invoker.hpp b/include/details/threaded_handler_invoker.hpp index cdd474f..6d17b8b 100644 --- a/include/details/threaded_handler_invoker.hpp +++ b/include/details/threaded_handler_invoker.hpp @@ -57,7 +57,7 @@ class threaded_handler_invoker : public handler_invoker_base, private boost::thr private: threaded_handler_invoker(threaded_handler_invoker const &); threaded_handler_invoker& operator = (threaded_handler_invoker const &); - + typedef boost::intrusive_ptr holder_ptr_type; typedef std::pair item_type; typedef threaded_queue queue_type; diff --git a/include/details/websocket_info.hpp b/include/details/websocket_info.hpp index 429ee1b..f7ddb01 100644 --- a/include/details/websocket_info.hpp +++ b/include/details/websocket_info.hpp @@ -29,7 +29,7 @@ class websocket_info { public: websocket_info(); - + bool empty() const; bool valid() const; diff --git a/include/xiva/component_set.hpp b/include/xiva/component_set.hpp index b5ef2b9..be6992c 100644 --- a/include/xiva/component_set.hpp +++ b/include/xiva/component_set.hpp @@ -29,9 +29,9 @@ namespace xiva { -/** - * This is an interface of container that holds references to - * common components such as logger. It helps to provide +/** + * This is an interface of container that holds references to + * common components such as logger. It helps to provide * components from dynamically loaded modules to the system. */ class XIVA_API component_set { @@ -39,16 +39,16 @@ class XIVA_API component_set { public: /** default constructor */ component_set(); - + /** destructor */ virtual ~component_set(); - /** attaches an instance of the logger. + /** attaches an instance of the logger. * @param log an instance of class that implements logger interface. - */ + */ virtual void attach_logger(boost::intrusive_ptr const &log) = 0; - - /** sets up the response handler + + /** sets up the response handler * @param m an instance of class that implements response handler interface. */ virtual void attach_response_handler(boost::intrusive_ptr const &m) = 0; @@ -63,7 +63,7 @@ class XIVA_API component_set { * @param creator an instance of class that implements request-cpecific formatter interface. */ virtual void attach_formatter_creator(std::string const &fmt_id, boost::intrusive_ptr const &creator) = 0; - + /** adds the connection_listener to the system. * @param l an instance of class that implements connection_listener interface. */ @@ -75,7 +75,7 @@ class XIVA_API component_set { */ virtual void start_provider(unsigned short nthreads, boost::function f) = 0; - /** sets up the message filter + /** sets up the message filter * @param filter an instance of class that implements message filter interface. */ virtual void attach_message_filter(boost::intrusive_ptr const &filter) = 0; @@ -83,7 +83,7 @@ class XIVA_API component_set { private: /** shuold never be implemented */ component_set(component_set const &); - + /** shuold never be implemented */ component_set& operator = (component_set const &); }; diff --git a/include/xiva/connection_listener.hpp b/include/xiva/connection_listener.hpp index f3a8d34..d67208e 100644 --- a/include/xiva/connection_listener.hpp +++ b/include/xiva/connection_listener.hpp @@ -27,11 +27,11 @@ namespace xiva { -/** - * This interface provides two callbacks which are called when +/** + * This interface provides two callbacks which are called when * connection to a particular user is established or closed. - * You shoud implement this interface and provide an instance to - * the system to know whether to send messages to the particular + * You shoud implement this interface and provide an instance to + * the system to know whether to send messages to the particular * user or not. */ class XIVA_API connection_listener : public shared { @@ -39,18 +39,18 @@ class XIVA_API connection_listener : public shared { public: /** default constructor */ connection_listener(); - + /** destructor */ virtual ~connection_listener(); - /** this function is called when the connection to the user is - * established and the user or subsystem that initiated the request + /** this function is called when the connection to the user is + * established and the user or subsystem that initiated the request * is matched * @param to user or subsystem name * @param id the identifier of connection */ virtual void connection_opened(std::string const &to, globals::connection_id id) throw (std::exception) = 0; - + /** this function is called when the connection to the user is closed * @param to user or subsystem name * @param id the identifier of connection @@ -65,7 +65,7 @@ class XIVA_API connection_listener : public shared { private: /** should never be implemented */ connection_listener(connection_listener const &); - + /** should never be implemented */ connection_listener& operator = (connection_listener const &); }; diff --git a/include/xiva/enumeration.hpp b/include/xiva/enumeration.hpp index 33d554c..fb93605 100644 --- a/include/xiva/enumeration.hpp +++ b/include/xiva/enumeration.hpp @@ -25,9 +25,9 @@ namespace xiva { -/** - * Analogically to java.util.Enumeration, this interface represents - * an abstract iterator over the sequence. +/** + * Analogically to java.util.Enumeration, this interface represents + * an abstract iterator over the sequence. */ template class XIVA_API enumeration : public shared { @@ -35,7 +35,7 @@ class XIVA_API enumeration : public shared { public: /** default constructor */ enumeration(); - + /** destructor */ virtual ~enumeration(); @@ -52,7 +52,7 @@ class XIVA_API enumeration : public shared { private: /** should be never implemented */ enumeration(enumeration const &); - + /** should be never implemented */ enumeration& operator = (enumeration const &); }; diff --git a/include/xiva/error.hpp b/include/xiva/error.hpp index 8c9a6e8..9c5bab6 100644 --- a/include/xiva/error.hpp +++ b/include/xiva/error.hpp @@ -24,7 +24,7 @@ namespace xiva { -/** +/** * This is the xiva-specific exception. */ class XIVA_API error : public std::exception { @@ -35,8 +35,8 @@ class XIVA_API error : public std::exception { /** destructor */ virtual ~error() throw (); - - /** inherited from std::exception + + /** inherited from std::exception * @return textual description of error. */ virtual char const* what() const throw (); diff --git a/include/xiva/response.hpp b/include/xiva/response.hpp index 13d0a55..204f756 100644 --- a/include/xiva/response.hpp +++ b/include/xiva/response.hpp @@ -48,7 +48,7 @@ class XIVA_API response { private: response(response const &); response& operator = (response const &); - + private: details::response_impl &impl_; }; diff --git a/include/xiva/response_handler.hpp b/include/xiva/response_handler.hpp index 46d30fe..7fb2ad3 100644 --- a/include/xiva/response_handler.hpp +++ b/include/xiva/response_handler.hpp @@ -36,7 +36,7 @@ class XIVA_API response_handler : public shared { virtual bool threaded() const = 0; virtual bool has_enough_data(request const &req) const = 0; - + virtual std::string receiver(request const &req) const = 0; virtual void handle_response(request const &req, response &resp) = 0; diff --git a/library/Makefile.am b/library/Makefile.am index 47cb20f..50ec515 100644 --- a/library/Makefile.am +++ b/library/Makefile.am @@ -25,4 +25,4 @@ libxiva_loader_la_SOURCES = dynamic_loader.cpp AM_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/config \ @INCLTDL@ @BOOST_CPPFLAGS@ AM_CXXFLAGS = -pthread -AM_LDFLAGS = @BOOST_LDFLAGS@ +AM_LDFLAGS = @BOOST_LDFLAGS@ diff --git a/library/compound_listener.cpp b/library/compound_listener.cpp index 39e2c6b..94c6ab9 100644 --- a/library/compound_listener.cpp +++ b/library/compound_listener.cpp @@ -121,7 +121,7 @@ compound_listener::notify_connection_closed(std::string const &to, globals::conn void compound_listener::notify_disconnected(std::string const &to) { try { - std::for_each(listeners_.begin(), listeners_.end(), + std::for_each(listeners_.begin(), listeners_.end(), boost::bind(&connection_listener::disconnected, _1, boost::cref(to))); } catch (std::exception const &e) { diff --git a/library/formatters_data_simple.cpp b/library/formatters_data_simple.cpp index f1b4800..7fd72f3 100644 --- a/library/formatters_data_simple.cpp +++ b/library/formatters_data_simple.cpp @@ -57,7 +57,7 @@ formatters_data_simple::update(message const& msg) { void formatters_data_simple::update_channels_stat(channels_stat_impl &ch_stat, bool add) const { - (void) ch_stat; + (void) ch_stat; (void) add; } diff --git a/library/guard.cpp b/library/guard.cpp index b2c0cae..da4547c 100644 --- a/library/guard.cpp +++ b/library/guard.cpp @@ -53,5 +53,5 @@ guard::close() { state_ = GUARD_CLOSED; return true; } - + }} // namespaces diff --git a/library/handler_invoker.cpp b/library/handler_invoker.cpp index 46423e0..c16f931 100644 --- a/library/handler_invoker.cpp +++ b/library/handler_invoker.cpp @@ -50,10 +50,10 @@ handler_invoker::invoke_handler(handler_invoker::connection_ptr_type conn, reque request request_adapter(req); if (!handler_->has_enough_data(request_adapter)) { throw http_error(http_error::forbidden); - } + } std::string receiver = handler_->receiver(request_adapter); conn->name(receiver); - + response response_adapter(resp); handler_->handle_response(request_adapter, response_adapter); conn->handled(req, resp); diff --git a/library/http.cpp b/library/http.cpp index a6f1b29..0a87dce 100644 --- a/library/http.cpp +++ b/library/http.cpp @@ -67,7 +67,7 @@ http_header::connection_keep_alive() { } http_status::http_status(unsigned short status) : - code_(status) + code_(status) { } diff --git a/library/server_impl.cpp b/library/server_impl.cpp index 94d55f6..f0d3b9a 100644 --- a/library/server_impl.cpp +++ b/library/server_impl.cpp @@ -50,7 +50,7 @@ server_impl::~server_impl() { } } -void +void server_impl::finish() { data_->stop(); if (acceptor_) { @@ -244,7 +244,7 @@ server_impl::attach_response_handler(boost::intrusive_ptr cons void server_impl::attach_ping_formatter(boost::intrusive_ptr const &f) { assert(f); - ping_formatter_ = f; + ping_formatter_ = f; } void diff --git a/library/threaded_handler_invoker.cpp b/library/threaded_handler_invoker.cpp index beef4de..84cde2a 100644 --- a/library/threaded_handler_invoker.cpp +++ b/library/threaded_handler_invoker.cpp @@ -27,7 +27,7 @@ class request_holder : public threaded_shared { public: request_holder(); virtual ~request_holder(); - + request_impl& request(); response_impl& response(); void attach(request_impl &req, response_impl &resp); @@ -35,7 +35,7 @@ class request_holder : public threaded_shared { void set_error_msg(std::string const &msg); void set_error_msg(char const *msg); void set_http_error_code(unsigned short code); - + void handled(threaded_connection &conn) const; private: @@ -48,7 +48,7 @@ class request_holder : public threaded_shared { static std::string const FINISH_ERROR_MSG("finish"); static std::string const UNKNOWN_ERROR_MSG("unknown exception while invoking handler"); -threaded_handler_invoker::threaded_handler_invoker(asio::io_service::strand &st, connection_data const &data) : +threaded_handler_invoker::threaded_handler_invoker(asio::io_service::strand &st, connection_data const &data) : strand_(st) { boost::intrusive_ptr handler = data.handler(); @@ -139,7 +139,7 @@ threaded_handler_invoker::invoke_handler(threaded_handler_invoker::connection_pt if (!handler_->has_enough_data(r)) { throw http_error(http_error::forbidden); } - + holder_ptr_type holder(new request_holder()); holder->attach(req, resp); if (!input_queue_.push(item_type(holder, conn))) { diff --git a/library/websocket_info.cpp b/library/websocket_info.cpp index 0ce9e1c..480203a 100644 --- a/library/websocket_info.cpp +++ b/library/websocket_info.cpp @@ -81,7 +81,7 @@ WS_STR_SECRET_WORD = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; static const boost::uint8_t WS_SMALL_MSG_MAX_SIZE = 125; -websocket_info::websocket_info() : +websocket_info::websocket_info() : empty_(true), proto_78_(false) { } @@ -144,7 +144,7 @@ websocket_info::write_close(std::ostream &stream) const { stream << '\x88'; return true; } - + static boost::int32_t get_websocket_key_value(char const *s, std::string const &key) { boost::int64_t v = 0; @@ -213,7 +213,7 @@ websocket_info::parse_sec_key(request_impl const &req) { BUF_MEM *bptr = NULL; BIO_get_mem_ptr(b64, &bptr); - if (NULL == bptr || NULL == bptr->data || bptr->length != (BASE64_LENGTH(SHA_OUTPUT_SIZE) + 1)) { + if (NULL == bptr || NULL == bptr->data || bptr->length != (BASE64_LENGTH(SHA_OUTPUT_SIZE) + 1)) { throw std::runtime_error("can not create accept data in websocket request"); } sec_data_.assign((const char*)bptr->data, bptr->length - 1); diff --git a/python/cleanup_list.cpp b/python/cleanup_list.cpp index cff2fa4..d1d01c0 100644 --- a/python/cleanup_list.cpp +++ b/python/cleanup_list.cpp @@ -78,7 +78,7 @@ cleanup_list::thread_func() { objects_type to_destroy_now; to_destroy_now.swap(to_destroy_); - } + } catch (std::exception const &e) { (void) e; } @@ -93,6 +93,6 @@ cleanup_list_auto::cleanup_list_auto(cleanup_list &cleanup) : cleanup_(cleanup) cleanup_list_auto::~cleanup_list_auto() { cleanup_.stop(); } - + }} // namespaces diff --git a/python/python_handler.cpp b/python/python_handler.cpp index a8bba7e..d51f271 100644 --- a/python/python_handler.cpp +++ b/python/python_handler.cpp @@ -12,7 +12,7 @@ namespace xiva { namespace python { python_handler::python_handler(py::object const &impl) : - impl_(impl) + impl_(impl) { } @@ -30,7 +30,7 @@ python_handler::has_enough_data(request const &req) const { try { python_request request_adapter(req); interpreter_lock lock; - + return py::call_method(impl_.ptr(), "has_enough_data", request_adapter); } catch (std::exception const &) { @@ -47,7 +47,7 @@ python_handler::receiver(request const &req) const { try { python_request request_adapter(req); interpreter_lock lock; - + return py::call_method(impl_.ptr(), "receiver", request_adapter); } catch (std::exception const &) { diff --git a/python/python_handler.hpp b/python/python_handler.hpp index d3ca4df..f658f6e 100644 --- a/python/python_handler.hpp +++ b/python/python_handler.hpp @@ -34,7 +34,7 @@ class python_handler : public response_handler { virtual bool threaded() const; virtual bool has_enough_data(request const &req) const; - + virtual std::string receiver(request const &req) const; virtual void handle_response(request const &req, response &resp); diff --git a/python/python_logger.hpp b/python/python_logger.hpp index 79488df..1500e63 100644 --- a/python/python_logger.hpp +++ b/python/python_logger.hpp @@ -52,7 +52,7 @@ class python_logger : public logger, private boost::thread_group { typedef std::pair queue_item_type; typedef details::threaded_queue queue_type; typedef queue_type::raw_items_type items_type; - + void process_items(items_type const &items) const; void invoke(char level, char const *format, va_list args); diff --git a/python/python_request.cpp b/python/python_request.cpp index 60323c7..dc44733 100644 --- a/python/python_request.cpp +++ b/python/python_request.cpp @@ -10,7 +10,7 @@ namespace xiva { namespace python { python_request::python_request(request const &req) : - req_(req) + req_(req) { } diff --git a/python/python_server.cpp b/python/python_server.cpp index 1a5a2fe..78e472a 100644 --- a/python/python_server.cpp +++ b/python/python_server.cpp @@ -24,7 +24,7 @@ namespace xiva { namespace python { python_server::python_server() : - impl_(new details::server_impl()) + impl_(new details::server_impl()) { signal(SIGPIPE, SIG_IGN); } diff --git a/tests/Makefile.am b/tests/Makefile.am index 33d81c0..4a449f9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,7 +8,7 @@ xiva_tests_SOURCES = main.cpp mock_connection.cpp mock_listener.cpp \ xiva_tests_LDADD = \ ${top_srcdir}/library/libxiva.la \ ${top_srcdir}/library/libxiva-loader.la - + AM_CXXFLAGS = -pthread AM_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/config \ -I${top_srcdir}/daemon @BOOST_CPPFLAGS@ @@ -26,5 +26,5 @@ noinst_DATA = test.conf noinst_HEADERS = mock_connection.hpp mock_listener.hpp mock_logger.hpp \ test_utils.hpp - + TESTS = xiva-tests diff --git a/tests/mock_connection.cpp b/tests/mock_connection.cpp index 2e2b6e4..e3e32bc 100644 --- a/tests/mock_connection.cpp +++ b/tests/mock_connection.cpp @@ -53,6 +53,6 @@ mock_connection::handled_errors( (void) http_code; (void) error_msg; } - + }} // namespaces diff --git a/tests/mock_connection.hpp b/tests/mock_connection.hpp index 145737a..bec3569 100644 --- a/tests/mock_connection.hpp +++ b/tests/mock_connection.hpp @@ -41,7 +41,7 @@ class mock_connection : public details::connection { virtual void handled_errors( details::request_impl const &req, details::response_impl const &resp, unsigned short http_code, std::string const &error_msg); - + private: mock_connection(mock_connection const &); diff --git a/utils/Makefile.am b/utils/Makefile.am index 4c8c024..378ed85 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -5,4 +5,4 @@ xiva_util_LDFLAGS = @BOOST_THREAD_LDFLAGS@ @BOOST_SYSTEM_LDFLAGS@ AM_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/config @BOOST_CPPFLAGS@ AM_CXXFLAGS = -pthread -AM_LDFLAGS = @BOOST_LDFLAGS@ +AM_LDFLAGS = @BOOST_LDFLAGS@ diff --git a/xiva-bf.spec b/xiva-bf.spec index 26f23fe..e5fe40e 100644 --- a/xiva-bf.spec +++ b/xiva-bf.spec @@ -137,5 +137,5 @@ rm -rf %{buildroot} %changelog -* Thu Oct 29 2009 Arkady L. Shane +* Thu Oct 29 2009 Arkady L. Shane - initial yandex's rpm build diff --git a/xiva.spec b/xiva.spec index e10cf2e..c361630 100644 --- a/xiva.spec +++ b/xiva.spec @@ -137,6 +137,6 @@ rm -rf %{buildroot} %changelog -* Thu Oct 29 2009 Arkady L. Shane +* Thu Oct 29 2009 Arkady L. Shane - initial yandex's rpm build