Comparison

net/server_epoll.lua @ 10309:2a31571efce0

net.server_epoll: Guard against nil return from TLS info method
author Kim Alvefur <zash@zash.se>
date Sun, 06 Oct 2019 19:34:03 +0200
parent 10307:6a997f0ceba8
child 10328:5c2b31c823b9
comparison
equal deleted inserted replaced
10308:48e392dbf6e7 10309:2a31571efce0
546 self.onreadable = interface.tlshandskake; 546 self.onreadable = interface.tlshandskake;
547 return self:init(); 547 return self:init();
548 end 548 end
549 local ok, err = self.conn:dohandshake(); 549 local ok, err = self.conn:dohandshake();
550 if ok then 550 if ok then
551 if self.conn.info then 551 local info = self.conn.info and self.conn:info();
552 local info = self.conn:info(); 552 if type(info) == "table" then
553 self:debug("TLS handshake complete (%s with %s)", info.protocol, info.cipher); 553 self:debug("TLS handshake complete (%s with %s)", info.protocol, info.cipher);
554 else 554 else
555 self:debug("TLS handshake complete"); 555 self:debug("TLS handshake complete");
556 end 556 end
557 self.onwritable = nil; 557 self.onwritable = nil;