Comparison

net/server_epoll.lua @ 7603:4e2b019ff176

net.server_epoll: Make sure wantwrite is set when starting TLS
author Kim Alvefur <zash@zash.se>
date Thu, 18 Aug 2016 17:17:16 +0200
parent 7602:a4d5eec36a17
child 7604:36408ef6c8c9
comparison
equal deleted inserted replaced
7602:a4d5eec36a17 7603:4e2b019ff176
376 function interface:starttls(ctx) 376 function interface:starttls(ctx)
377 if ctx then self.tls = ctx; end 377 if ctx then self.tls = ctx; end
378 if self.writebuffer and self.writebuffer[1] then 378 if self.writebuffer and self.writebuffer[1] then
379 log("debug", "Start TLS on %s after write", tostring(self)); 379 log("debug", "Start TLS on %s after write", tostring(self));
380 self._starttls = true; 380 self._starttls = true;
381 self:setflags(nil, true); -- make sure wantwrite is set
381 else 382 else
382 log("debug", "Start TLS on %s now", tostring(self)); 383 log("debug", "Start TLS on %s now", tostring(self));
383 self:setflags(false, false); 384 self:setflags(false, false);
384 local conn, err = luasec.wrap(self.conn, ctx or self.tls); 385 local conn, err = luasec.wrap(self.conn, ctx or self.tls);
385 if not conn then 386 if not conn then