# HG changeset patch # User Kim Alvefur # Date 1618406473 -7200 # Node ID 83822be7704d0f515108d7c89bfa134130f3466e # Parent 10d13e0554f91c6f8cf237e55ab315d7878251ad util.xmppstream: Send declaration in same call as stream open If network_settings.opportunistic_writes is enabled then this would previously have resulted in two socket writes, and possibly two packets being sent. This caused some issues in older versions of Gajim, which apparently expected the stream opening in the first packet, and thus it could not connect. With this change and opportunistic_writes enabled, the first packet should contain both the xml declaration and the stream open tag. Without opportunistic_writes, there should be no observable change. Tested with Gajim 1.1.2 (on same machine). Unsure if loopback behaves differently than the network here. diff -r 10d13e0554f9 -r 83822be7704d util/xmppstream.lua --- a/util/xmppstream.lua Tue Apr 06 23:25:15 2021 +0200 +++ b/util/xmppstream.lua Wed Apr 14 15:21:13 2021 +0200 @@ -268,8 +268,7 @@ if session.stream_attrs then session:stream_attrs(from, to, attr) end - send(""); - send(st.stanza("stream:stream", attr):top_tag()); + send(""..st.stanza("stream:stream", attr):top_tag()); return true; end