Comparison

init.lua @ 505:289c866d7fb0

verse: Fix to work with server_epoll
author Kim Alvefur <zash@zash.se>
date Sat, 24 Jun 2023 09:48:23 +0200
parent 492:22844ac3be4e
comparison
equal deleted inserted replaced
504:8ed3c95bf880 505:289c866d7fb0
150 function stream:close(reason) 150 function stream:close(reason)
151 if not self.conn then 151 if not self.conn then
152 verse.log("error", "Attempt to close disconnected connection - possibly a bug"); 152 verse.log("error", "Attempt to close disconnected connection - possibly a bug");
153 return; 153 return;
154 end 154 end
155 local on_disconnect = self.conn.disconnect();
156 self:event("shutdown"); 155 self:event("shutdown");
157 self.conn:close(); 156 self.conn:close();
158 on_disconnect(self.conn, reason);
159 end 157 end
160 158
161 -- Logging functions 159 -- Logging functions
162 function stream:debug(...) 160 function stream:debug(...)
163 return self.logger("debug", ...); 161 return self.logger("debug", ...);