Comparison

core/s2smanager.lua @ 259:1485d272400d

Some more logging fixes
author Matthew Wild <mwild1@gmail.com>
date Fri, 14 Nov 2008 02:41:37 +0000
parent 258:a93ccd84db83
child 260:182f0c895676
comparison
equal deleted inserted replaced
258:a93ccd84db83 259:1485d272400d
101 log("warn", "s2s connect() failed: %s", err); 101 log("warn", "s2s connect() failed: %s", err);
102 end 102 end
103 103
104 conn = wraptlsclient(cl, conn, to_host, 5269, 0, 1, hosts[from_host].ssl_ctx ); 104 conn = wraptlsclient(cl, conn, to_host, 5269, 0, 1, hosts[from_host].ssl_ctx );
105 host_session.conn = conn; 105 host_session.conn = conn;
106 106
107 -- Register this outgoing connection so that xmppserver_listener knows about it 107 -- Register this outgoing connection so that xmppserver_listener knows about it
108 -- otherwise it will assume it is a new incoming connection 108 -- otherwise it will assume it is a new incoming connection
109 cl.register_outgoing(conn, host_session); 109 cl.register_outgoing(conn, host_session);
110 110
111 do 111 do
112 local conn_name = "s2sout"..tostring(conn):match("[a-f0-9]*$"); 112 local conn_name = "s2sout"..tostring(conn):match("[a-f0-9]*$");
113 host_session.log = logger_init(conn_name); 113 host_session.log = logger_init(conn_name);
114 end 114 end
115 115
120 120
121 return host_session; 121 return host_session;
122 end 122 end
123 123
124 function streamopened(session, attr) 124 function streamopened(session, attr)
125 session.log("debug", "s2s stream opened");
126 local send = session.sends2s; 125 local send = session.sends2s;
127 126
128 session.version = tonumber(attr.version) or 0; 127 session.version = tonumber(attr.version) or 0;
129 if session.version >= 1.0 and not (attr.to and attr.from) then 128 if session.version >= 1.0 and not (attr.to and attr.from) then
130 print("to: "..tostring(attr.to).." from: "..tostring(attr.from)); 129 print("to: "..tostring(attr.to).." from: "..tostring(attr.from));
164 for _, feature in ipairs(features) do 163 for _, feature in ipairs(features) do
165 send(tostring(feature)); 164 send(tostring(feature));
166 end 165 end
167 166
168 send("</stream:features>");]] 167 send("</stream:features>");]]
169 log("info", "s2s stream opened successfully"); 168
170 session.notopen = nil; 169 session.notopen = nil;
171 end 170 end
172 171
173 function initiate_dialback(session) 172 function initiate_dialback(session)
174 -- generate dialback key 173 -- generate dialback key