Software / code / prosody
Comparison
plugins/mod_component.lua @ 4655:9159546cb2f3
mod_component: Handle component connecting to non-existent host
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 22 Apr 2012 16:35:26 +0100 |
| parent | 4650:464ca74ddf6a |
| child | 4734:4d43dbd6de17 |
comparison
equal
deleted
inserted
replaced
| 4654:0975505f5a54 | 4655:9159546cb2f3 |
|---|---|
| 147 session:close(nil, text); | 147 session:close(nil, text); |
| 148 end | 148 end |
| 149 end | 149 end |
| 150 | 150 |
| 151 function stream_callbacks.streamopened(session, attr) | 151 function stream_callbacks.streamopened(session, attr) |
| 152 if not hosts[attr.to].modules.component then | 152 if not hosts[attr.to] or not hosts[attr.to].modules.component then |
| 153 session:close{ condition = "host-unknown", text = tostring(attr.to).." does not match any configured external components" }; | 153 session:close{ condition = "host-unknown", text = tostring(attr.to).." does not match any configured external components" }; |
| 154 return; | 154 return; |
| 155 end | 155 end |
| 156 session.host = attr.to; | 156 session.host = attr.to; |
| 157 session.streamid = uuid_gen(); | 157 session.streamid = uuid_gen(); |