Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanocasazza committed Jul 28, 2018
1 parent b5184ba commit d2421aa
Show file tree
Hide file tree
Showing 28 changed files with 1,166 additions and 938 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ cleandist:
$(distdir)/src/ulib/orm/driver/.libs \
$(distdir)/src/ulib/orm/driver/Makefile \
$(distdir)/src/ulib/orm/driver/libpq/Makefile \
$(distdir)/src/ulib/orm/driver/libpq/libpq.la \
$(distdir)/src/ulib/net/server/plugin/*.o \
$(distdir)/src/ulib/net/server/plugin/*.l? \
$(distdir)/src/ulib/net/server/plugin/.deps \
Expand Down
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ cleandist:
$(distdir)/src/ulib/orm/driver/.libs \
$(distdir)/src/ulib/orm/driver/Makefile \
$(distdir)/src/ulib/orm/driver/libpq/Makefile \
$(distdir)/src/ulib/orm/driver/libpq/libpq.la \
$(distdir)/src/ulib/net/server/plugin/*.o \
$(distdir)/src/ulib/net/server/plugin/*.l? \
$(distdir)/src/ulib/net/server/plugin/.deps \
Expand Down
101 changes: 1 addition & 100 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,6 @@ TCC_TRUE
PRG_LDFLAGS
POSTGRESQL_USE_OPENSSL_FALSE
POSTGRESQL_USE_OPENSSL_TRUE
HAVE_PGSQL_BATCH_API_FALSE
HAVE_PGSQL_BATCH_API_TRUE
HAVE_PGSQL_FALSE
HAVE_PGSQL_TRUE
POSTGRESQL_LIBS
Expand Down Expand Up @@ -30414,14 +30412,6 @@ else
HAVE_PGSQL_FALSE=
fi

if false; then
HAVE_PGSQL_BATCH_API_TRUE=
HAVE_PGSQL_BATCH_API_FALSE='#'
else
HAVE_PGSQL_BATCH_API_TRUE='#'
HAVE_PGSQL_BATCH_API_FALSE=
fi

if false; then
POSTGRESQL_USE_OPENSSL_TRUE=
POSTGRESQL_USE_OPENSSL_FALSE='#'
Expand All @@ -30443,87 +30433,6 @@ fi

$as_echo "#define USE_PGSQL 1" >>confdefs.h


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing PQenterBatchMode" >&5
$as_echo_n "checking for library containing PQenterBatchMode... " >&6; }
if ${ac_cv_search_PQenterBatchMode+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_PQenterBatchMode="no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char PQenterBatchMode ();
int
main ()
{
return PQenterBatchMode ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_search_PQenterBatchMode="none required"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
test "$ac_cv_search_PQenterBatchMode" = "no" && for i in pq; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char PQenterBatchMode ();
int
main ()
{
return PQenterBatchMode ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_search_PQenterBatchMode="-l$i"
break
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
LIBS="$ac_func_search_save_LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_PQenterBatchMode" >&5
$as_echo "$ac_cv_search_PQenterBatchMode" >&6; }
if test "$ac_cv_search_PQenterBatchMode" != "no"; then
test "$ac_cv_search_PQenterBatchMode" = "none required" || POSTGRESQL_LIBS="$POSTGRESQL_LIBS $ac_cv_search_PQenterBatchMode"

else :

fi
if test "$ac_cv_search_PQenterBatchMode" = "yes"; then
if true; then
HAVE_PGSQL_BATCH_API_TRUE=
HAVE_PGSQL_BATCH_API_FALSE='#'
else
HAVE_PGSQL_BATCH_API_TRUE='#'
HAVE_PGSQL_BATCH_API_FALSE=
fi


$as_echo "#define USE_PGSQL_BATCH_API 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether PostgreSQL use openssl" >&5
$as_echo_n "checking whether PostgreSQL use openssl... " >&6; }
if test -n "`pg_config --configure | grep openssl`"; then
Expand Down Expand Up @@ -34142,7 +34051,7 @@ fi
CXX_MAYBE_FLAGS_MODERN=""

if test "$found_postgresql" = "yes"; then
if test "$ac_cv_search_PQenterBatchMode" = "yes"; then
if test "$static_handler_pgsql" != "yes"; then
CC_MAYBE_FLAGS="$CC_MAYBE_FLAGS -Wc++-compat -Wold-style-definition"
else
CC_MAYBE_FLAGS="$CC_MAYBE_FLAGS -Wno-discarded-qualifiers -Wno-switch-enum -Wno-missing-field-initializers -Wno-sign-compare -Wno-strict-aliasing \
Expand Down Expand Up @@ -36021,10 +35930,6 @@ if test -z "${HAVE_PGSQL_TRUE}" && test -z "${HAVE_PGSQL_FALSE}"; then
as_fn_error $? "conditional \"HAVE_PGSQL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_PGSQL_BATCH_API_TRUE}" && test -z "${HAVE_PGSQL_BATCH_API_FALSE}"; then
as_fn_error $? "conditional \"HAVE_PGSQL_BATCH_API\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${POSTGRESQL_USE_OPENSSL_TRUE}" && test -z "${POSTGRESQL_USE_OPENSSL_FALSE}"; then
as_fn_error $? "conditional \"POSTGRESQL_USE_OPENSSL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand All @@ -36033,10 +35938,6 @@ if test -z "${HAVE_PGSQL_TRUE}" && test -z "${HAVE_PGSQL_FALSE}"; then
as_fn_error $? "conditional \"HAVE_PGSQL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_PGSQL_BATCH_API_TRUE}" && test -z "${HAVE_PGSQL_BATCH_API_FALSE}"; then
as_fn_error $? "conditional \"HAVE_PGSQL_BATCH_API\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${POSTGRESQL_USE_OPENSSL_TRUE}" && test -z "${POSTGRESQL_USE_OPENSSL_FALSE}"; then
as_fn_error $? "conditional \"POSTGRESQL_USE_OPENSSL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand Down
8 changes: 1 addition & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1433,17 +1433,11 @@ AC_CHECK_MYSQL
AX_LIB_POSTGRESQL

AM_CONDITIONAL(HAVE_PGSQL, false)
AM_CONDITIONAL(HAVE_PGSQL_BATCH_API, false)
AM_CONDITIONAL(POSTGRESQL_USE_OPENSSL, false)

if test "$found_postgresql" = "yes"; then
AM_CONDITIONAL(HAVE_PGSQL, true)
AC_DEFINE(USE_PGSQL, 1, [Define if enable PostgreSQL database support])
AC_SEARCH_LIBS_VAR([PQenterBatchMode], pq, , , , POSTGRESQL_LIBS)
if test "$ac_cv_search_PQenterBatchMode" = "yes"; then
AM_CONDITIONAL(HAVE_PGSQL_BATCH_API, true)
AC_DEFINE(USE_PGSQL_BATCH_API, 1, [Define if PostgreSQL database support batch API])
fi
AC_MSG_CHECKING([whether PostgreSQL use openssl])
if test -n "`pg_config --configure | grep openssl`"; then
AC_MSG_RESULT([yes])
Expand Down Expand Up @@ -2424,7 +2418,7 @@ if test "$ac_cv_c_compiler_gnu" = "yes" -a "x$OPERATINGSYSTEM" = xlinux; then
CXX_MAYBE_FLAGS_MODERN=""

if test "$found_postgresql" = "yes"; then
if test "$ac_cv_search_PQenterBatchMode" = "yes"; then
if test "$static_handler_pgsql" != "yes"; then
CC_MAYBE_FLAGS="$CC_MAYBE_FLAGS -Wc++-compat -Wold-style-definition"
else
CC_MAYBE_FLAGS="$CC_MAYBE_FLAGS -Wno-discarded-qualifiers -Wno-switch-enum -Wno-missing-field-initializers -Wno-sign-compare -Wno-strict-aliasing \
Expand Down
3 changes: 0 additions & 3 deletions include/ulib/internal/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,6 @@
/* Define if enable PostgreSQL database support */
#undef USE_PGSQL

/* Define if PostgreSQL database support batch API */
#undef USE_PGSQL_BATCH_API

/* Define if enable php support */
#undef USE_PHP

Expand Down
4 changes: 0 additions & 4 deletions src/ulib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ EXTRA_DIST = base/* container/* db/* debug/* dynamic/* flex/* internal/* ldap/*

if HAVE_PGSQL
if STATIC_ORM_DRIVER_PGSQL
if !HAVE_PGSQL_BATCH_API
SUBDIRS = orm/driver/libpq
endif
endif
endif

DEFAULT_INCLUDES = -I. -I$(top_builddir)/include

Expand Down Expand Up @@ -311,10 +309,8 @@ lib@ULIB@_la_LDFLAGS = @ULIB_LIBS@

if STATIC_ORM_DRIVER_PGSQL
SRC_CPP += orm/driver/orm_driver_pgsql.cpp
if !HAVE_PGSQL_BATCH_API
lib@ULIB@_la_LDFLAGS += $(top_builddir)/src/ulib/orm/driver/libpq/libpq.la @POSTGRESQL_LDFLAGS@ @POSTGRESQL_LIBS@
endif
endif

lib@ULIB@_la_LDFLAGS += -version-info 1:0:0 -release @ULIB_VERSION@

Expand Down
4 changes: 2 additions & 2 deletions src/ulib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ target_triplet = @target@
@STATIC_ORM_DRIVER_SQLITE_TRUE@am__append_63 = orm/driver/orm_driver_sqlite.cpp
@STATIC_ORM_DRIVER_MYSQL_TRUE@am__append_64 = orm/driver/orm_driver_mysql.cpp
@STATIC_ORM_DRIVER_PGSQL_TRUE@am__append_65 = orm/driver/orm_driver_pgsql.cpp
@HAVE_PGSQL_BATCH_API_FALSE@@STATIC_ORM_DRIVER_PGSQL_TRUE@am__append_66 = $(top_builddir)/src/ulib/orm/driver/libpq/libpq.la @POSTGRESQL_LDFLAGS@ @POSTGRESQL_LIBS@
@STATIC_ORM_DRIVER_PGSQL_TRUE@am__append_66 = $(top_builddir)/src/ulib/orm/driver/libpq/libpq.la @POSTGRESQL_LDFLAGS@ @POSTGRESQL_LIBS@
@MINGW_TRUE@am__append_67 = -export-symbols $(srcdir)/@[email protected] -no-undefined -Wl,ULib-win32-res.o

# Handler static http servlet
Expand Down Expand Up @@ -769,7 +769,7 @@ EXTRA_DIST = base/* container/* db/* debug/* dynamic/* flex/* internal/* ldap/*
net/server/plugin/*.cpp net/server/plugin/Makefile.* \
*.cpp all_c.c ULib.pc.in ULib.rc.in utility/bin

@HAVE_PGSQL_BATCH_API_FALSE@@HAVE_PGSQL_TRUE@@STATIC_ORM_DRIVER_PGSQL_TRUE@SUBDIRS = orm/driver/libpq
@HAVE_PGSQL_TRUE@@STATIC_ORM_DRIVER_PGSQL_TRUE@SUBDIRS = orm/driver/libpq
DEFAULT_INCLUDES = -I. -I$(top_builddir)/include
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ULib.pc
Expand Down
2 changes: 2 additions & 0 deletions src/ulib/event/event_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ void UEventDB::addClientImage(vPFpvu handlerResult, uint32_t num_query)
(void) U_SYSCALL(PQflush, "%p", (PGconn*)conn);
#endif

#if defined(U_SERVER_CAPTIVE_PORTAL) && defined(ENABLE_THREAD)
UClientImage_Base::setRequestProcessed();
#endif

U_INTERNAL_DUMP("start = %u end = %u", start, end)

Expand Down
5 changes: 4 additions & 1 deletion src/ulib/net/server/plugin/usp/json.usp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Test type 1: JSON serialization
TechEmpower Web Framework Benchmarks
-->
<!--#declaration
static char* ptr;
static UString* pkey;
static UString* pvalue;

Expand Down Expand Up @@ -32,13 +33,15 @@ if (*pwbuffer == '\0')
u_put_unalignedp64(pwbuffer+44, U_MULTICHAR_CONSTANT64('n','/','j','s','o','n','\r','\n'));
u_put_unalignedp16(pwbuffer+52, U_MULTICHAR_CONSTANT16('\r','\n'));

UValue::pstringify = pwbuffer + U_CONSTANT_SIZE("Content-Length: 27\r\nContent-Type: application/json\r\n\r\n");
ptr = pwbuffer + U_CONSTANT_SIZE("Content-Length: 27\r\nContent-Type: application/json\r\n\r\n");

UClientImage_Base::wbuffer->size_adjust_constant(U_CONSTANT_SIZE("Content-Length: 27\r\nContent-Type: application/json\r\n\r\n") + 27);
}

U_INTERNAL_ASSERT_EQUALS(u_get_unalignedp64(UClientImage_Base::wbuffer->data()), U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'))
U_INTERNAL_ASSERT_EQUALS(u_get_unalignedp64(UClientImage_Base::wbuffer->c_pointer(44)), U_MULTICHAR_CONSTANT64('n','/','j','s','o','n','\r','\n'))

UValue::pstringify = ptr;

UValue(*pkey, *pvalue).stringify();
-->
3 changes: 2 additions & 1 deletion src/ulib/orm/driver/loader.autoconf.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@


loadStaticLinkedModules(U_STRING_FROM_CONSTANT("pgsql"));
15 changes: 14 additions & 1 deletion tests/.function
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,25 @@ set_ADDRESS() {
# function : prepare_usp
prepare_usp() {

# rm -f db.la query.la update.la fortune.la cached_worlds.la \
# mdb.la mquery.la mupdate.la mfortune.la \
# rdb.la rquery.la rupdate.la rfortune.la \
# edb.la equery.la eupdate.la; \
# AM_LDFLAGS="-lWorld" make db.la query.la update.la cached_worlds.la 2>&1; \
# AM_LDFLAGS="-lWorld -lWorldNoSql" make mdb.la mquery.la mupdate.la 2>&1; \
# AM_LDFLAGS="-lWorld -lWorldNoSql" make rdb.la rquery.la rupdate.la 2>&1; \
# AM_LDFLAGS="-lWorld -lWorldNoSql" make edb.la equery.la eupdate.la 2>&1; \
# AM_LDFLAGS="-lFortune" make fortune.la 2>&1; \
# AM_LDFLAGS="-lFortune -lFortuneNoSql" make mfortune.la 2>&1; \
# AM_LDFLAGS="-lFortune -lFortuneNoSql" make rfortune.la 2>&1; \

if [ "$TERM" != "cygwin" ]; then
if [ ! -d ../db ]; then
mkdir -p ../db
fi
rm -f ../db/session.ssl.jnl
( cd ../../src/ulib/net/server/plugin/usp/; ./usp2so.sh >/tmp/usp2so.sh.out 2>&1 || exit 1; \
( cd ../../src/ulib/net/server/plugin/usp/; make; \
./usp2so.sh >/tmp/usp2so.sh.out 2>&1 || exit 1; \
test -d ../.libs && cd ../.libs; \
ln -sf ../v8/.libs/server_plugin_v8.so; \
ln -sf ../php/.libs/server_plugin_php.so; \
Expand Down
Loading

0 comments on commit d2421aa

Please sign in to comment.