Comparison

util/xmppstream.lua @ 11516:83822be7704d

util.xmppstream: Send <?xml?> 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.
author Kim Alvefur <zash@zash.se>
date Wed, 14 Apr 2021 15:21:13 +0200
parent 11358:ebbf8dca33d2
child 11560:3bbb1af92514
comparison
equal deleted inserted replaced
11515:10d13e0554f9 11516:83822be7704d
266 from = from or session.host, to = to, 266 from = from or session.host, to = to,
267 }; 267 };
268 if session.stream_attrs then 268 if session.stream_attrs then
269 session:stream_attrs(from, to, attr) 269 session:stream_attrs(from, to, attr)
270 end 270 end
271 send("<?xml version='1.0'?>"); 271 send("<?xml version='1.0'?>"..st.stanza("stream:stream", attr):top_tag());
272 send(st.stanza("stream:stream", attr):top_tag());
273 return true; 272 return true;
274 end 273 end
275 274
276 return { 275 return {
277 reset = function () 276 reset = function ()