net.server: Fix multiple return values

return foo and foo() crops multiple return values to a single one, so
any second return values etc were last, mostly error details.

Introduced in 7e9ebdc75ce4
This commit is contained in:
Kim Alvefur 2022-06-03 17:51:42 +02:00
parent 2048a7a762
commit 88a2c1ffe0
3 changed files with 26 additions and 11 deletions

View file

@ -627,22 +627,26 @@ end
function interface:ssl_info()
local sock = self.conn;
return sock.info and sock:info();
if not sock.info then return nil, "not-implemented"; end
return sock:info();
end
function interface:ssl_peercertificate()
local sock = self.conn;
return sock.getpeercertificate and sock:getpeercertificate();
if not sock.getpeercertificate then return nil, "not-implemented"; end
return sock:getpeercertificate();
end
function interface:ssl_peerverification()
local sock = self.conn;
return sock.getpeerverification and sock:getpeerverification();
if not sock.getpeerverification then return nil, { { "Chain verification not supported" } }; end
return sock:getpeerverification();
end
function interface:ssl_peerfinished()
local sock = self.conn;
return sock.getpeerfinished and sock:getpeerfinished();
if not sock.getpeerfinished then return nil, "not-implemented"; end
return sock:getpeerfinished();
end
function interface:starttls(tls_ctx)