aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/server_epoll.lua6
-rw-r--r--net/server_event.lua1
-rw-r--r--net/server_select.lua3
3 files changed, 10 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 96e7b201..f48086e3 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -575,6 +575,12 @@ local function wrapsocket(client, server, read_size, listeners, tls_ctx, extra)
extra = extra;
}, interface_mt);
+ if extra then
+ if extra.servername then
+ conn.servername = extra.servername;
+ end
+ end
+
conn:updatenames();
return conn;
end
diff --git a/net/server_event.lua b/net/server_event.lua
index 950a7a5c..2b791291 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -516,6 +516,7 @@ local function handleclient( client, ip, port, server, pattern, listener, sslctx
_sslctx = sslctx; -- parameters
_usingssl = false; -- client is using ssl;
extra = extra;
+ servername = extra and extra.servername;
}
if not has_luasec then interface.starttls = false; end
interface.id = tostring(interface):match("%x+$");
diff --git a/net/server_select.lua b/net/server_select.lua
index de183331..e15f5298 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -317,6 +317,9 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
local handler = bufferqueue -- saves a table ^_^
handler.extra = extra
+ if extra then
+ handler.servername = extra.servername
+ end
handler.dispatch = function( )
return dispatch