Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libstrophe for openSUSE:Factory 
checked in at 2022-07-12 11:12:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstrophe (Old)
 and      /work/SRC/openSUSE:Factory/.libstrophe.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstrophe"

Tue Jul 12 11:12:27 2022 rev:12 rq:988565 version:0.12.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstrophe/libstrophe.changes    2022-07-05 
12:10:28.724642782 +0200
+++ /work/SRC/openSUSE:Factory/.libstrophe.new.1523/libstrophe.changes  
2022-07-12 11:12:40.183716529 +0200
@@ -1,0 +2,6 @@
+Mon Jul 11 11:47:49 UTC 2022 - Michael Vetter <mvet...@suse.com>
+
+- Add libstrophe-0.12-stream-management-fix.patch:
+  To fix connection issues with Stream Management
+
+-------------------------------------------------------------------

New:
----
  libstrophe-0.12-stream-management-fix.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libstrophe.spec ++++++
--- /var/tmp/diff_new_pack.t9JOus/_old  2022-07-12 11:12:40.515716963 +0200
+++ /var/tmp/diff_new_pack.t9JOus/_new  2022-07-12 11:12:40.519716969 +0200
@@ -25,6 +25,8 @@
 Group:          Development/Libraries/C and C++
 URL:            http://strophe.im/libstrophe/
 Source0:        
https://github.com/strophe/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
+# See https://github.com/strophe/libstrophe/pull/211
+Patch0:         libstrophe-0.12-stream-management-fix.patch
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  gcc
@@ -63,6 +65,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 ./bootstrap.sh

++++++ libstrophe-0.12-stream-management-fix.patch ++++++
>From 9e2942957a117b8f4f8ea665f638c778c3717623 Mon Sep 17 00:00:00 2001
From: Steffen Jaeckel <jaeckel-fl...@eyet-services.de>
Date: Tue, 31 May 2022 08:59:48 +0200
Subject: [PATCH] reset relevant parts of SM state on disconnect

Prevent assuming SM is enabled if the connection gets re-used without a
complete destroy&re-create of the connection object.

Signed-off-by: Steffen Jaeckel <jaeckel-fl...@eyet-services.de>
---
 src/conn.c | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/src/conn.c b/src/conn.c
index fb34dbd..98d5493 100644
--- a/src/conn.c
+++ b/src/conn.c
@@ -79,6 +79,7 @@
 #endif
 
 static int _disconnect_cleanup(xmpp_conn_t *conn, void *userdata);
+static void _reset_sm_state_for_reconnect(xmpp_conn_t *conn);
 static char *_conn_build_stream_tag(xmpp_conn_t *conn,
                                     char **attributes,
                                     size_t attributes_len);
@@ -975,6 +976,7 @@ void conn_disconnect(xmpp_conn_t *conn)
         conn->tls = NULL;
     }
     sock_close(conn->sock);
+    _reset_sm_state_for_reconnect(conn);
 
     /* fire off connection handler */
     conn->conn_handler(conn, XMPP_CONN_DISCONNECT, conn->error,
@@ -1298,30 +1300,36 @@ xmpp_sm_state_t *xmpp_conn_get_sm_state(xmpp_conn_t 
*conn)
 
     ret = conn->sm_state;
     conn->sm_state = NULL;
-    if (ret->previd) {
-        strophe_free(conn->ctx, ret->previd);
-        ret->previd = NULL;
+
+    return ret;
+}
+
+static void _reset_sm_state_for_reconnect(xmpp_conn_t *conn)
+{
+    xmpp_sm_state_t *s = conn->sm_state;
+
+    if (s->previd) {
+        strophe_free(conn->ctx, s->previd);
+        s->previd = NULL;
     }
 
-    if (ret->can_resume) {
-        ret->previd = ret->id;
-        ret->id = NULL;
+    if (s->can_resume) {
+        s->previd = s->id;
+        s->id = NULL;
 
-        ret->bound_jid = conn->bound_jid;
+        s->bound_jid = conn->bound_jid;
         conn->bound_jid = NULL;
-    } else if (ret->id) {
-        strophe_free(conn->ctx, ret->id);
-        ret->id = NULL;
+    } else if (s->id) {
+        strophe_free(conn->ctx, s->id);
+        s->id = NULL;
     }
 
-    ret->sm_enabled = ret->sm_support = ret->resume = 0;
+    s->sm_enabled = s->sm_support = s->resume = 0;
 
-    if (ret->bind) {
-        xmpp_stanza_release(ret->bind);
-        ret->bind = NULL;
+    if (s->bind) {
+        xmpp_stanza_release(s->bind);
+        s->bind = NULL;
     }
-
-    return ret;
 }
 
 /**

Reply via email to