Comparison

plugins/mod_s2s/mod_s2s.lua @ 6367:769a3577dd85

Merge 0.9->0.10
author Matthew Wild <mwild1@gmail.com>
date Thu, 28 Aug 2014 09:23:24 +0100
parent 6337:925aceee8280
parent 6364:4e93e8768c36
child 6382:57d23c26039b
comparison
equal deleted inserted replaced
6355:c2d144d3f8dd 6367:769a3577dd85
345 end 345 end
346 346
347 log("debug", "Sending stream features: %s", tostring(features)); 347 log("debug", "Sending stream features: %s", tostring(features));
348 send(features); 348 send(features);
349 end 349 end
350 session.notopen = nil;
350 elseif session.direction == "outgoing" then 351 elseif session.direction == "outgoing" then
352 session.notopen = nil;
351 -- If we are just using the connection for verifying dialback keys, we won't try and auth it 353 -- If we are just using the connection for verifying dialback keys, we won't try and auth it
352 if not attr.id then error("stream response did not give us a streamid!!!"); end 354 if not attr.id then error("stream response did not give us a streamid!!!"); end
353 session.streamid = attr.id; 355 session.streamid = attr.id;
354 356
355 if session.secure and not session.cert_chain_status then 357 if session.secure and not session.cert_chain_status then
379 else 381 else
380 mark_connected(session); 382 mark_connected(session);
381 end 383 end
382 end 384 end
383 end 385 end
384 session.notopen = nil;
385 end 386 end
386 387
387 function stream_callbacks.streamclosed(session) 388 function stream_callbacks.streamclosed(session)
388 (session.log or log)("debug", "Received </stream:stream>"); 389 (session.log or log)("debug", "Received </stream:stream>");
389 session:close(false); 390 session:close(false);
390 end 391 end
391 392
392 function stream_callbacks.error(session, error, data) 393 function stream_callbacks.error(session, error, data)
393 if error == "no-stream" then 394 if error == "no-stream" then
395 session.log("debug", "Invalid opening stream header (%s)", (data:gsub("^([^\1]+)\1", "{%1}")));
394 session:close("invalid-namespace"); 396 session:close("invalid-namespace");
395 elseif error == "parse-error" then 397 elseif error == "parse-error" then
396 session.log("debug", "Server-to-server XML parse error: %s", tostring(error)); 398 session.log("debug", "Server-to-server XML parse error: %s", tostring(error));
397 session:close("not-well-formed"); 399 session:close("not-well-formed");
398 elseif error == "stream-error" then 400 elseif error == "stream-error" then
499 501
500 session.notopen = true; 502 session.notopen = true;
501 503
502 function session.reset_stream() 504 function session.reset_stream()
503 session.notopen = true; 505 session.notopen = true;
506 session.streamid = nil;
504 session.stream:reset(); 507 session.stream:reset();
505 end 508 end
506 509
507 session.stream_attrs = session_stream_attrs; 510 session.stream_attrs = session_stream_attrs;
508 511