Comparison

plugins/mod_s2s/mod_s2s.lua @ 6359:c74670b3be53

mod_s2s: Mark stream as opened earlier for outgoing connections, fixes double stream headers on policy failures
author Kim Alvefur <zash@zash.se>
date Tue, 26 Aug 2014 21:50:08 +0200
parent 5975:0d219631d47b
child 6362:f5f44504e18b
comparison
equal deleted inserted replaced
6358:55fda5deb5d5 6359:c74670b3be53
360 end 360 end
361 361
362 log("debug", "Sending stream features: %s", tostring(features)); 362 log("debug", "Sending stream features: %s", tostring(features));
363 send(features); 363 send(features);
364 end 364 end
365 session.notopen = nil;
365 elseif session.direction == "outgoing" then 366 elseif session.direction == "outgoing" then
367 session.notopen = nil;
366 -- If we are just using the connection for verifying dialback keys, we won't try and auth it 368 -- If we are just using the connection for verifying dialback keys, we won't try and auth it
367 if not attr.id then error("stream response did not give us a streamid!!!"); end 369 if not attr.id then error("stream response did not give us a streamid!!!"); end
368 session.streamid = attr.id; 370 session.streamid = attr.id;
369 371
370 if session.secure and not session.cert_chain_status then 372 if session.secure and not session.cert_chain_status then
394 else 396 else
395 mark_connected(session); 397 mark_connected(session);
396 end 398 end
397 end 399 end
398 end 400 end
399 session.notopen = nil;
400 end 401 end
401 402
402 function stream_callbacks.streamclosed(session) 403 function stream_callbacks.streamclosed(session)
403 (session.log or log)("debug", "Received </stream:stream>"); 404 (session.log or log)("debug", "Received </stream:stream>");
404 session:close(false); 405 session:close(false);