Permalink
Browse files

sync

  • Loading branch information...
1 parent 3c6a6f4 commit 7f5acbc66a70115a337f75eb18fbc55dca6ee8b7 @stefanocasazza committed Apr 19, 2011
Showing with 1,006 additions and 8,873 deletions.
  1. +8 −8 README.md
  2. +25 −28 ULib.m4
  3. +17 −6 ULib.spec.in
  4. +49 −4 configure
  5. +10 −4 configure.in
  6. +1 −1 examples/uclient/uclient.cpp
  7. +8 −8 examples/userver/userver.cfg.default
  8. +7 −4 examples/userver/userver.cpp
  9. +3 −0 include/ulib/internal/config.h.in
  10. +2 −1 include/ulib/net/server/server.h
  11. +0 −2 include/ulib/notifier.h
  12. +59 −78 include/ulib/thread.h
  13. +0 −2 include/ulib/timer.h
  14. +12 −12 rpm.sh
  15. +12 −12 rpm.sh.in
  16. +5 −1 src/ulib/Makefile.am
  17. +121 −119 src/ulib/Makefile.in
  18. +4 −0 src/ulib/all_cpp.cpp
  19. +1 −3 src/ulib/net/ipaddress.cpp
  20. +1 −1 src/ulib/net/server/client_image.cpp
  21. +1 −1 src/ulib/net/server/plugin/mod_http.cpp
  22. +2 −0 src/ulib/net/server/server.cpp
  23. +1 −1 src/ulib/notifier.cpp
  24. +354 −94 src/ulib/thread.cpp
  25. +0 −6 src/ulib/timer.cpp
  26. +12 −12 src/ulib/utility/interrupt.cpp
  27. +1 −1 src/ulib/utility/services.cpp
  28. +0 −7 tests/examples/IR/WEB/form/it/result.doc
  29. +0 −2 tests/examples/IR/WEB/form/it/result.pag
  30. +0 −4 tests/examples/IR/WEB/form/it/result.top
  31. +0 −53 tests/examples/IR/WEB/form/it/seek.hlp
  32. +0 −74 tests/examples/IR/WEB/form/it/seek.tmpl
  33. +0 −7 tests/examples/IR/WEB/form/it/seek.top
  34. +0 −19 tests/examples/RA/RA/mail/card-generation.tmpl
  35. +0 −63 tests/examples/RA/RA/mail/mail-business.tmpl
  36. +0 −71 tests/examples/RA/RA/mail/mail-cpe.tmpl
  37. +0 −22 tests/examples/RA/RA/www/admin/cgi-bin/.admin
  38. +0 −172 tests/examples/RA/RA/www/admin/cgi-bin/.base
  39. +0 −9 tests/examples/RA/RA/www/admin/cgi-bin/.env
  40. +0 −17 tests/examples/RA/RA/www/admin/cgi-bin/card-generation.bash
  41. +0 −77 tests/examples/RA/RA/www/admin/form/en/card-generation.tmpl
  42. +0 −77 tests/examples/RA/RA/www/admin/form/it/card-generation.tmpl
  43. +0 −172 tests/examples/RA/RA/www/ra-station/cgi-bin/.base
  44. +0 −9 tests/examples/RA/RA/www/ra-station/cgi-bin/.env
  45. +0 −589 tests/examples/RA/RA/www/ra-station/cgi-bin/.registrazione
  46. +0 −60 tests/examples/RA/RA/www/ra-station/cgi-bin/registrazione-business.bash
  47. +0 −60 tests/examples/RA/RA/www/ra-station/cgi-bin/registrazione-residenziale-con-cpe.bash
  48. +0 −596 tests/examples/RA/RA/www/ra-station/css/style.css
  49. +0 −15 tests/examples/RA/RA/www/ra-station/form/en/contratto-bottoni.tmpl
  50. +0 −110 tests/examples/RA/RA/www/ra-station/form/en/contratto-informativa.html
  51. +0 −221 tests/examples/RA/RA/www/ra-station/form/en/contratto-privacy.html
  52. +0 −529 tests/examples/RA/RA/www/ra-station/form/en/contratto-registrazione-business.tmpl
  53. +0 −605 tests/examples/RA/RA/www/ra-station/form/en/contratto-registrazione-residenziale-con-cpe.tmpl
  54. +0 −52 tests/examples/RA/RA/www/ra-station/form/en/error.tmpl
  55. +0 −367 tests/examples/RA/RA/www/ra-station/form/en/registrazione-business.tmpl
  56. +0 −449 tests/examples/RA/RA/www/ra-station/form/en/registrazione-residenziale-con-cpe.tmpl
  57. +0 −7 tests/examples/RA/RA/www/ra-station/form/en/rid-bottoni.tmpl
  58. +0 −553 tests/examples/RA/RA/www/ra-station/form/en/rid.tmpl
  59. +0 −20 tests/examples/RA/RA/www/ra-station/form/en/stampa.js
  60. +0 −31 tests/examples/RA/RA/www/ra-station/form/en/view.tmpl
  61. +0 −15 tests/examples/RA/RA/www/ra-station/form/it/contratto-bottoni.tmpl
  62. +0 −110 tests/examples/RA/RA/www/ra-station/form/it/contratto-informativa.html
  63. +0 −221 tests/examples/RA/RA/www/ra-station/form/it/contratto-privacy.html
  64. +0 −529 tests/examples/RA/RA/www/ra-station/form/it/contratto-registrazione-business.tmpl
  65. +0 −605 tests/examples/RA/RA/www/ra-station/form/it/contratto-registrazione-residenziale-con-cpe.tmpl
  66. +0 −52 tests/examples/RA/RA/www/ra-station/form/it/error.tmpl
  67. +0 −365 tests/examples/RA/RA/www/ra-station/form/it/registrazione-business.tmpl
  68. +0 −447 tests/examples/RA/RA/www/ra-station/form/it/registrazione-residenziale-con-cpe.tmpl
  69. +0 −7 tests/examples/RA/RA/www/ra-station/form/it/rid-bottoni.tmpl
  70. +0 −553 tests/examples/RA/RA/www/ra-station/form/it/rid.tmpl
  71. +0 −20 tests/examples/RA/RA/www/ra-station/form/it/stampa.js
  72. +0 −32 tests/examples/RA/RA/www/ra-station/form/it/view.tmpl
  73. BIN tests/examples/RA/RA/www/ra-station/images/dx-logo.png
  74. BIN tests/examples/RA/RA/www/ra-station/images/sx-logo.jpg
  75. +0 −38 tests/examples/RA/RA/www/ra-station/index.html
  76. +0 −4 tests/examples/RA/RA/www/ra-station/js/livevalidation_standalone.js
  77. +0 −61 tests/examples/RA/userver/bin/RA
  78. +0 −61 tests/examples/RA/userver/bin/RA.5
  79. +0 −117 tests/examples/RA/userver/bin/RA.6
  80. +1 −1 tests/examples/TSA/CA/tsaserial
  81. +7 −2 tests/ulib/Makefile.am
  82. +66 −60 tests/ulib/Makefile.in
  83. BIN tests/ulib/inp/test.db
  84. +12 −0 tests/ulib/ok/ldap.ok
  85. +49 −0 tests/ulib/ok/thread.ok
  86. +154 −45 tests/ulib/test_thread.cpp
  87. +1 −0 tests/ulib/thread.test
View
@@ -35,11 +35,11 @@ The current version offers the following features :
* Support for [JSONRequest](http://json.org/JSONRequest.html).
* Accept HTTP uploads up to 4 GB without increasing memory usage.
* Support for upload progress via USP (ULib Servlet Page).
+ * General [CGI](http://it.wikipedia.org/wiki/Common_Gateway_Interface) support (run any CGI script) with automatic output compression (using deflate method).
* CGI support for shell script processes (with automatic management of form and cookie).
- * General CGI support (run any CGI script) with automatic output compression (using deflate method).
* CGI support for the X-Sendfile feature and also supports X-Accel-Redirect headers transparently.
* Support for minify HTML CGI output with wrapping [google page speed SDK](http://code.google.com/speed/page-speed/download.html#pagespeed-sdk).
- * Web Socket support (experimental).
+ * [Web Socket](http://dev.w3.org/html5/websockets) support (experimental).
* Support for Windows (without preforking).
* Requests cut in phases for modular architecture (apache-like).
* Configuration file with dedicated section.
@@ -49,13 +49,13 @@ The current version offers the following features :
* mod_http : core features, static file handler and dynamic page (ULib Servlet Page).
* mod_ssi : [Server Side Includes]( http://en.wikipedia.org/wiki/Server_Side_Include) support with enhanced #set, direct include and #exec usp (ULib Servlet Page).
* mod_nocat : [captive portal](http://nocat.net/) implementation.
- * mod_tsa : server side Time Stamp support.
- * mod_soap : generic SOAP server services support.
- * mod_fcgi : third-party applications support thru FastCGI interface.
- * mod_scgi : module that implements the client side of the SCGI protocol (experimental).
- * mod_shib : web single sign-on support (experimental).
+ * mod_tsa : server side [Time Stamp](http://www.opentsa.org) support.
+ * mod_soap : generic [SOAP](http://java.sun.com/developer/technicalArticles/xml/webservices) server services support.
+ * mod_fcgi : third-party applications support thru [FastCGI](http://www.fastcgi.com/drupal) interface.
+ * mod_scgi : module that implements the client side of the [SCGI](http://www.mems-exchange.org/software/scgi) protocol (experimental).
+ * mod_shib : [web single sign-on support](http://shibboleth.internet2.edu) (experimental).
* mod_proxy : proxy support (experimental).
- * mod_geoip : geolocation support (experimental).
+ * mod_geoip : [geolocation support](http://www.maxmind.com/geoip/api/c.shtml) (experimental).
* mod_stream : simple streaming support (experimental).
* mod_socket : web sockets application framework (experimental).
View
@@ -8,30 +8,26 @@ dnl This macro tries to find the ULib library and header files.
dnl
dnl We define the following configure script flags:
dnl
-dnl --with-ULib: Give prefix for both library and headers, and try
-dnl to guess subdirectory names for each.
-dnl --with-ULib-lib: Similar to --with-ULib, but for library only.
-dnl --with-ULib-include: Similar to --with-ULib, but for headers only.
+dnl --with-ulib: Give prefix for both library and headers, and try to guess subdirectory names for each.
+dnl
+dnl --with-ulib-lib: Similar to --with-ulib, but for library only.
+dnl --with-ulib-include: Similar to --with-ulib, but for headers only.
-AC_DEFUN([AC_ULIB],
-[
-AC_CACHE_CHECK([for ULib library stuff], ac_cv_ULib,
-[
- #
- # Set up configure script macros
- #
- AC_ARG_WITH(ULib,
- [ --with-ULib=<path> path containing ULib header and library subdirs],
- [ULIB_lib_check="$with_ULib/lib $with_ULib/lib/ULib"
- ULIB_inc_check="$with_ULib/include $with_ULib/include/ULib"],
- [ULIB_lib_check="/usr/local/ULib/lib /usr/local/lib/ULib /opt/ULib/lib /usr/lib/ULib /usr/local/lib /usr/lib"
- ULIB_inc_check="/usr/local/ULib/include /usr/local/include/ULib /opt/ULib/include /usr/local/include/ULib /usr/local/include /usr/include/ULib /usr/include"])
- AC_ARG_WITH(ULib-lib,
- [ --with-ULib-lib=<path> directory path of ULib library],
- [ULIB_lib_check="$with_ULib_lib $with_ULib_lib/lib $with_ULib_lib/lib/ULib"])
- AC_ARG_WITH(ULib-include,
- [ --with-ULib-include=<path> directory path of ULib headers],
- [ULIB_inc_check="$with_ULib_include $with_ULib_include/include $with_ULib_include/include/ULib"])
+AC_DEFUN([AC_ULIB],[
+AC_CACHE_CHECK([for ULib library stuff], ac_cv_ulib,
+[ # Set up configure script macros
+ AC_ARG_WITH(ulib,
+ [ --with-ulib=<path> path containing ULib header and library subdirs],
+ [ULIB_lib_check="$with_ulib/lib $with_ulib/lib/ulib"
+ ULIB_inc_check="$with_ulib/include $with_ulib/include/ulib"],
+ [ULIB_lib_check="/usr/local/ulib/lib /usr/local/lib/ulib /opt/ulib/lib /usr/lib/ulib /usr/local/lib /usr/lib"
+ ULIB_inc_check="/usr/local/ulib/include /usr/local/include/ulib /opt/ulib/include /usr/local/include/ulib /usr/local/include /usr/include/ulib /usr/include"])
+ AC_ARG_WITH(ulib-lib,
+ [ --with-ulib-lib=<path> directory path of ULib library],
+ [ULIB_lib_check="$with_ulib_lib $with_ulib_lib/lib $with_ulib_lib/lib/ulib"])
+ AC_ARG_WITH(ulib-include,
+ [ --with-ulib-include=<path> directory path of ULib headers],
+ [ULIB_inc_check="$with_ulib_include $with_ulib_include/include $with_ulib_include/include/ulib"])
#
# Look for ULib library
@@ -55,7 +51,7 @@ AC_CACHE_CHECK([for ULib library stuff], ac_cv_ULib,
case "$ULIB_libdir" in
/* ) ;;
- * ) AC_MSG_ERROR([The ULib library directory ($ULIB_libdir) must be an absolute path.]) ;;
+ * ) AC_MSG_ERROR([The ULib library directory ($ULIB_libdir) must be an absolute path.]) ;;
esac
AC_MSG_RESULT([lib in $ULIB_libdir])
@@ -65,7 +61,6 @@ AC_CACHE_CHECK([for ULib library stuff], ac_cv_ULib,
*) LDFLAGS="$LDFLAGS -L${ULIB_libdir}" ;;
esac
-
#
# Look for ULib headers
#
@@ -87,7 +82,7 @@ AC_CACHE_CHECK([for ULib library stuff], ac_cv_ULib,
case "$ULIB_incdir" in
/* ) ;;
- * ) AC_MSG_ERROR([The ULib header directory ($ULIB_incdir) must be an absolute path.]) ;;
+ * ) AC_MSG_ERROR([The ULib header directory ($ULIB_incdir) must be an absolute path.]) ;;
esac
AC_MSG_RESULT([$ULIB_incdir])
@@ -98,7 +93,9 @@ AC_CACHE_CHECK([for ULib library stuff], ac_cv_ULib,
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <all.h>],
[UString s; s.c_str();])],
- ac_cv_ULib=yes,
+ ac_cv_ulib=yes,
AC_MSG_ERROR(no))
-])]) dnl End ULIB
+])
+])
+dnl End ULIB
View
@@ -1,4 +1,4 @@
-Name: ULib
+Name: ulib
Summary: ULib C++ library - A package for creating small and fast C++ programs
Version: @VERSION@
Release: 1
@@ -9,7 +9,7 @@ URL: http://www.unirel.com
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}
Provides: ULib
-Packager: Stefano Casazza <stefano.casazza@unirel.com>
+Packager: Stefano Casazza <stefano.casazza@gmail.com>
@RPM_REQUIRE@
@@ -36,24 +36,32 @@ make LDFLAGS="-s"
%install
rm -rf %{buildroot}
%makeinstall
-mkdir -p %{buildroot}/usr/libexec/ulib
+mkdir -p %{_sysconfdir}/ulib
mkdir -p %{buildroot}/usr/share/aclocal
+mkdir -p %{buildroot}/usr/libexec/ulib/usp
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING NEWS README TODO ChangeLog
+%{_bindir}/uclient
+%{_bindir}/userver_*
%{_libdir}/*.so.*
-%{_libexecdir}/ulib/mod_*.so
-%dir %{_libexecdir}/ulib
+%{_sysconfdir}/*.cfg*
+%{_libexecdir}/ulib/mod_*.*
+%{_libexecdir}/ulib/usp/*.*
+%dir %{_libexecdir}/ulib/usp
%files devel
%defattr(-,root,root,-)
+%{_bindir}/uclient
+%{_bindir}/userver_*
%{_libdir}/*.a
%{_libdir}/*.so
%{_libdir}/*.la
+%{_sysconfdir}/*.cfg*
%dir %{_includedir}/ulib
%{_includedir}/ulib/*.h
%{_includedir}/ulib/README
@@ -69,7 +77,10 @@ rm -rf %{buildroot}
%{_libexecdir}/ulib/mod_*.a
%{_libexecdir}/ulib/mod_*.so
%{_libexecdir}/ulib/mod_*.la
-%dir %{_libexecdir}/ulib
+%{_libexecdir}/ulib/usp/*.a
+%{_libexecdir}/ulib/usp/*.so
+%{_libexecdir}/ulib/usp/*.la
+%dir %{_libexecdir}/ulib/usp
%post -p /sbin/ldconfig
View
@@ -705,6 +705,8 @@ THREAD_FLAGS
thrprefix
SEMAPHORE_FALSE
SEMAPHORE_TRUE
+PTHREAD_FALSE
+PTHREAD_TRUE
PLUGIN_FALSE
PLUGIN_TRUE
PAGE_SPEED_FALSE
@@ -22537,6 +22539,14 @@ fi
fi
if true; then
+ PTHREAD_TRUE=
+ PTHREAD_FALSE='#'
+else
+ PTHREAD_TRUE='#'
+ PTHREAD_FALSE=
+fi
+
+ if true; then
SEMAPHORE_TRUE=
SEMAPHORE_FALSE='#'
else
@@ -24677,6 +24687,14 @@ $as_echo "#define COMMON_AIX_FIXES 1" >>confdefs.h
if true; then
+ PTHREAD_TRUE=
+ PTHREAD_FALSE='#'
+else
+ PTHREAD_TRUE='#'
+ PTHREAD_FALSE=
+fi
+
+ if true; then
SEMAPHORE_TRUE=
SEMAPHORE_FALSE='#'
else
@@ -24686,6 +24704,14 @@ fi
LIBS_SAVE="${LIBS_SAVE} -l$ost_cv_thread_library";
else
+ if false; then
+ PTHREAD_TRUE=
+ PTHREAD_FALSE='#'
+else
+ PTHREAD_TRUE='#'
+ PTHREAD_FALSE=
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_init in -lrt" >&5
$as_echo_n "checking for sem_init in -lrt... " >&6; }
if ${ac_cv_lib_rt_sem_init+:} false; then :
@@ -27381,17 +27407,23 @@ _ACEOF
if test "$prefix" = "NONE"; then
prefix="/usr/local"
- pkglibexecdir="/usr/local/libexec/ulib"
-else
- pkglibexecdir="$prefix/libexec/ulib"
fi
-# pkugin dir
+sysconfdir="$prefix/etc/ulib"
+pkglibexecdir="$prefix/libexec/ulib"
+
+# plugin dir
cat >>confdefs.h <<_ACEOF
#define U_LIBEXECDIR "${pkglibexecdir}"
_ACEOF
+# config dir
+
+cat >>confdefs.h <<_ACEOF
+#define U_SYSCONFDIR "${sysconfdir}"
+_ACEOF
+
echo \
"------------------------------------------------------------------------
@@ -27401,6 +27433,7 @@ configure: Configured to build src/ulib/libulib:
Host setup: ${host}
Install prefix: ${prefix}
Install plugin: ${pkglibexecdir}
+ Configuration data: ${sysconfdir}
Operating System: $os_version
C++ Compiler: ${CXX} ( $gcc_version )
C Flags: ${CFLAGS}
@@ -27826,14 +27859,26 @@ if test -z "${PLUGIN_TRUE}" && test -z "${PLUGIN_FALSE}"; then
as_fn_error $? "conditional \"PLUGIN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${PTHREAD_TRUE}" && test -z "${PTHREAD_FALSE}"; then
+ as_fn_error $? "conditional \"PTHREAD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${SEMAPHORE_TRUE}" && test -z "${SEMAPHORE_FALSE}"; then
as_fn_error $? "conditional \"SEMAPHORE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${PTHREAD_TRUE}" && test -z "${PTHREAD_FALSE}"; then
+ as_fn_error $? "conditional \"PTHREAD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${SEMAPHORE_TRUE}" && test -z "${SEMAPHORE_FALSE}"; then
as_fn_error $? "conditional \"SEMAPHORE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${PTHREAD_TRUE}" && test -z "${PTHREAD_FALSE}"; then
+ as_fn_error $? "conditional \"PTHREAD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${SEMAPHORE_TRUE}" && test -z "${SEMAPHORE_FALSE}"; then
as_fn_error $? "conditional \"SEMAPHORE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
View
@@ -531,15 +531,18 @@ case "$target_os" in
else
AM_CONDITIONAL(PLUGIN, false)
fi
+ AM_CONDITIONAL(PTHREAD, true)
AM_CONDITIONAL(SEMAPHORE, true)
;;
*)
AC_CHECK_LIB(pthread,sem_init)
if test "$ac_cv_lib_pthread_sem_init" = "yes"; then
OST_LIB_PTHREAD
+ AM_CONDITIONAL(PTHREAD, true)
AM_CONDITIONAL(SEMAPHORE, true)
LIBS_SAVE="${LIBS_SAVE} -l$ost_cv_thread_library";
else
+ AM_CONDITIONAL(PTHREAD, false)
AC_CHECK_LIB(rt,sem_init)
if test "$ac_cv_lib_rt_sem_init" = "yes"; then
LIBS_SAVE="${LIBS_SAVE} -lrt";
@@ -1032,13 +1035,15 @@ AC_COMPILATION_ENVIRONMENT
if test "$prefix" = "NONE"; then
prefix="/usr/local"
- pkglibexecdir="/usr/local/libexec/ulib"
-else
- pkglibexecdir="$prefix/libexec/ulib"
fi
-# pkugin dir
+sysconfdir="$prefix/etc/ulib"
+pkglibexecdir="$prefix/libexec/ulib"
+
+# plugin dir
AC_DEFINE_UNQUOTED(U_LIBEXECDIR, "${pkglibexecdir}", [install directory for plugins])
+# config dir
+AC_DEFINE_UNQUOTED(U_SYSCONFDIR, "${sysconfdir}", [install directory for configuration data])
echo \
"------------------------------------------------------------------------
@@ -1048,6 +1053,7 @@ configure: Configured to build src/ulib/libulib:
Host setup: ${host}
Install prefix: ${prefix}
Install plugin: ${pkglibexecdir}
+ Configuration data: ${sysconfdir}
Operating System: $os_version
C++ Compiler: ${CXX} ( $gcc_version )
C Flags: ${CFLAGS}
@@ -54,7 +54,7 @@ class Application : public UApplication {
// manage file configuration
- if (cfg_str.empty()) cfg_str = U_STRING_FROM_CONSTANT("/etc/uclient.cfg");
+ if (cfg_str.empty()) cfg_str = U_STRING_FROM_CONSTANT(U_SYSCONFDIR "/uclient.cfg");
// ----------------------------------------------------------------------------------------------------------------------------------
// uclient - configuration parameters
Oops, something went wrong.

0 comments on commit 7f5acbc

Please sign in to comment.