]> granicus.if.org Git - ejabberd/commitdiff
* src/mod_roster.erl: Workaround for gateway subscriptions now
authorAlexey Shchepin <alexey@process-one.net>
Sun, 11 Dec 2005 19:48:31 +0000 (19:48 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Sun, 11 Dec 2005 19:48:31 +0000 (19:48 +0000)
should be enabled with --enable-roster-gateway-workaround
* src/mod_roster_odbc.erl: Likewise
* src/configure.ac: Likewise
* src/Makefile.in: Likewise

SVN Revision: 459

ChangeLog
src/Makefile.in
src/configure
src/configure.ac
src/mod_roster.erl
src/mod_roster_odbc.erl

index 6609eff7c1ef6ff121935626f04f91eef9ac7935..52c84809d87a5debf589e185b1bd0ed44f94f801 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-12-11  Alexey Shchepin  <alexey@sevcom.net>
+
+       * src/mod_roster.erl: Workaround for gateway subscriptions now
+       should be enabled with --enable-roster-gateway-workaround
+       * src/mod_roster_odbc.erl: Likewise
+       * src/configure.ac: Likewise
+       * src/Makefile.in: Likewise
+
 2005-12-10  Alexey Shchepin  <alexey@sevcom.net>
 
        * src/ejabberd_service.erl: Added logging of termination
index c8c56b34eb310945f86e479b55999235a8295eea..4f0567af0b4eb443317518627de82450785c4894 100644 (file)
@@ -17,10 +17,16 @@ ifdef debug
   ERLC_FLAGS+=+debug_info
 endif
 
+ifeq (@roster_gateway_workaround@, true)
+  ERLC_FLAGS+=-DROSTER_GATEWAY_WORKAROUND
+endif
+
 prefix = @prefix@
 
 SUBDIRS = @mod_irc@ @mod_pubsub@ @mod_muc@ @eldap@ @web@ stringprep @tls@ @odbc@
 ERLSHLIBS = expat_erl.so
+SOURCES = $(wildcard *.erl)
+BEAMS = $(SOURCES:.erl=.beam)
 
 DESTDIR =
 
@@ -36,8 +42,10 @@ ASN_FLAGS = -bber_bin +der +compact_bit_string +optimize +noobj
 
 all: $(ERLSHLIBS) compile-beam all-recursive
 
-compile-beam: XmppAddr.hrl
-       @ERLC@ $(ERLC_FLAGS) *.erl
+compile-beam: XmppAddr.hrl $(BEAMS)
+
+%.beam:       %.erl
+       @ERLC@ -W $(ERLC_FLAGS) $<
 
 
 all-recursive install-recursive uninstall-recursive \
@@ -51,7 +59,7 @@ mostlyclean-recursive maintainer-clean-recursive:
 
 
 %.hrl: %.asn1
-       erlc $(ASN_FLAGS) $<
+       @ERLC@ $(ASN_FLAGS) $<
 
 $(ERLSHLIBS):  %.so:   %.c
                        gcc -Wall $(CFLAGS) $(LDFLAGS) $(LIBS) \
index d286c76208eaa63f8ca7968edaba17ccb8abeeb4..132cbc9279404fa33d4ae4fa5b78df4cff1702f1 100755 (executable)
@@ -310,7 +310,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE ERLC ac_pt_ERLC ERL ac_pt_ERL ERLANG_CFLAGS ERLANG_LIBS LIBICONV CPP EGREP EXPAT_CFLAGS EXPAT_LIBS LIBOBJS mod_pubsub make_mod_pubsub mod_irc make_mod_irc mod_muc make_mod_muc eldap make_eldap web make_web tls make_tls odbc make_odbc SSL_LIBS SSL_CFLAGS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE ERLC ac_pt_ERLC ERL ac_pt_ERL ERLANG_CFLAGS ERLANG_LIBS LIBICONV CPP EGREP EXPAT_CFLAGS EXPAT_LIBS LIBOBJS mod_pubsub make_mod_pubsub mod_irc make_mod_irc mod_muc make_mod_muc eldap make_eldap web make_web tls make_tls odbc make_odbc roster_gateway_workaround SSL_LIBS SSL_CFLAGS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -850,6 +850,7 @@ Optional Features:
   --enable-web        enable web (default: yes)
   --enable-tls        enable tls (default: yes)
   --enable-odbc        enable odbc (default: no)
+  --enable-roster-gateway-workaround    Turn on workaround for processing gateway subscriptions
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -960,7 +961,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -1887,8 +1888,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -1946,8 +1946,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2063,8 +2062,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2118,8 +2116,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2164,8 +2161,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2209,8 +2205,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2603,8 +2598,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2654,8 +2648,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2712,8 +2705,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2792,8 +2784,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3117,8 +3108,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3288,8 +3278,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3374,8 +3363,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3448,8 +3436,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3653,8 +3640,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3721,8 +3707,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3951,8 +3936,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4240,6 +4224,21 @@ echo "${ECHO_T}$mr_enable_odbc" >&6
 
 
 
+# Check whether --enable-roster_gateway_workaround or --disable-roster_gateway_workaround was given.
+if test "${enable_roster_gateway_workaround+set}" = set; then
+  enableval="$enable_roster_gateway_workaround"
+  case "${enableval}" in
+  yes) roster_gateway_workaround=true ;;
+  no)  roster_gateway_workaround=false ;;
+  *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-roster-gateway-workaround" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-roster-gateway-workaround" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  roster_gateway_workaround=false
+fi;
+
+
                                                                                           ac_config_files="$ac_config_files Makefile $make_mod_irc $make_mod_muc $make_mod_pubsub $make_eldap $make_web stringprep/Makefile $make_tls $make_odbc"
 
 #openssl
@@ -4295,8 +4294,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4364,8 +4362,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5176,6 +5173,7 @@ s,@tls@,$tls,;t t
 s,@make_tls@,$make_tls,;t t
 s,@odbc@,$odbc,;t t
 s,@make_odbc@,$make_odbc,;t t
+s,@roster_gateway_workaround@,$roster_gateway_workaround,;t t
 s,@SSL_LIBS@,$SSL_LIBS,;t t
 s,@SSL_CFLAGS@,$SSL_CFLAGS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
@@ -5341,11 +5339,6 @@ esac
 
 
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -5384,6 +5377,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
         fi;;
       esac
     done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
index b31f180e32c5889c8d02c57160c62035409632c2..166eb438a5c6188f8b453b2ad2db756c0f28cef9 100644 (file)
@@ -30,6 +30,15 @@ AC_MOD_ENABLE(web, yes)
 AC_MOD_ENABLE(tls, yes)
 AC_MOD_ENABLE(odbc, no)
 
+AC_ARG_ENABLE(roster_gateway_workaround,
+[  --enable-roster-gateway-workaround    Turn on workaround for processing gateway subscriptions],
+[case "${enableval}" in
+  yes) roster_gateway_workaround=true ;;
+  no)  roster_gateway_workaround=false ;;
+  *) AC_MSG_ERROR(bad value ${enableval} for --enable-roster-gateway-workaround) ;;
+esac],[roster_gateway_workaround=false])
+AC_SUBST(roster_gateway_workaround)
+
 AC_CONFIG_FILES([Makefile
                  $make_mod_irc
                  $make_mod_muc
index 84d02aa41018a0c656b8fb4604c5272a19fe8266..6ca6f6c8be407b5892e1c582ce93152e8b124143 100644 (file)
@@ -453,10 +453,16 @@ process_subscription(Direction, User, Server, JID1, Type) ->
 
 %% in_state_change(Subscription, Pending, Type) -> NewState
 %% NewState = none | {NewSubscription, NewPending}
+-ifdef(ROSTER_GATEWAY_WORKAROUND).
+-define(NNSD, {to, none}).
+-define(NISD, {to, in}).
+-else.
+-define(NNSD, none).
+-define(NISD, none).
+-endif.
 
 in_state_change(none, none, subscribe)    -> {none, in};
-in_state_change(none, none, subscribed)   -> {to, none}; % Workaround for gateways
-%in_state_change(none, none, subscribed)   -> none;
+in_state_change(none, none, subscribed)   -> ?NNSD;
 in_state_change(none, none, unsubscribe)  -> none;
 in_state_change(none, none, unsubscribed) -> none;
 in_state_change(none, out,  subscribe)    -> {none, both};
@@ -464,8 +470,7 @@ in_state_change(none, out,  subscribed)   -> {to, none};
 in_state_change(none, out,  unsubscribe)  -> none;
 in_state_change(none, out,  unsubscribed) -> {none, none};
 in_state_change(none, in,   subscribe)    -> none;
-in_state_change(none, in,   subscribed)   -> {to, in}; % Workaround for gateways
-%in_state_change(none, in,   subscribed)   -> none;
+in_state_change(none, in,   subscribed)   -> ?NISD;
 in_state_change(none, in,   unsubscribe)  -> {none, none};
 in_state_change(none, in,   unsubscribed) -> none;
 in_state_change(none, both, subscribe)    -> none;
index d94b13b3287e680bc50ef99530250674e17e395d..8b14e432c2949b4b99ed5ac23cdca882e30c5cfa 100644 (file)
@@ -556,10 +556,16 @@ process_subscription(Direction, User, Server, JID1, Type) ->
 
 %% in_state_change(Subscription, Pending, Type) -> NewState
 %% NewState = none | {NewSubscription, NewPending}
+-ifdef(ROSTER_GATEWAY_WORKAROUND).
+-define(NNSD, {to, none}).
+-define(NISD, {to, in}).
+-else.
+-define(NNSD, none).
+-define(NISD, none).
+-endif.
 
 in_state_change(none, none, subscribe)    -> {none, in};
-in_state_change(none, none, subscribed)   -> {to, none}; % Workaround for gateways
-%in_state_change(none, none, subscribed)   -> none;
+in_state_change(none, none, subscribed)   -> ?NNSD;
 in_state_change(none, none, unsubscribe)  -> none;
 in_state_change(none, none, unsubscribed) -> none;
 in_state_change(none, out,  subscribe)    -> {none, both};
@@ -567,8 +573,7 @@ in_state_change(none, out,  subscribed)   -> {to, none};
 in_state_change(none, out,  unsubscribe)  -> none;
 in_state_change(none, out,  unsubscribed) -> {none, none};
 in_state_change(none, in,   subscribe)    -> none;
-in_state_change(none, in,   subscribed)   -> {to, in}; % Workaround for gateways
-%in_state_change(none, in,   subscribed)   -> none;
+in_state_change(none, in,   subscribed)   -> ?NISD;
 in_state_change(none, in,   unsubscribe)  -> {none, none};
 in_state_change(none, in,   unsubscribed) -> none;
 in_state_change(none, both, subscribe)    -> none;