Software / code / prosody
Comparison
net/server_epoll.lua @ 8006:be374a5778f3
net.server_epoll: Log if there's a connection without listeners
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 27 Mar 2017 03:40:24 +0200 |
| parent | 7910:91db637be237 |
| child | 8007:67f8954875a4 |
comparison
equal
deleted
inserted
replaced
| 8004:5b5c0142fc46 | 8006:be374a5778f3 |
|---|---|
| 141 self.listeners = listeners; | 141 self.listeners = listeners; |
| 142 end | 142 end |
| 143 | 143 |
| 144 -- Call a listener callback | 144 -- Call a listener callback |
| 145 function interface:on(what, ...) | 145 function interface:on(what, ...) |
| 146 if not self.listeners then | |
| 147 log("error", "%s has no listeners", self); | |
| 148 return; | |
| 149 end | |
| 146 local listener = self.listeners["on"..what]; | 150 local listener = self.listeners["on"..what]; |
| 147 if not listener then | 151 if not listener then |
| 148 -- log("debug", "Missing listener 'on%s'", what); -- uncomment for development and debugging | 152 -- log("debug", "Missing listener 'on%s'", what); -- uncomment for development and debugging |
| 149 return; | 153 return; |
| 150 end | 154 end |