# HG changeset patch # User Kim Alvefur # Date 1567295918 -7200 # Node ID d4390c427a6639c9137e63adf6e820f0ce20b12e # Parent 600eee3c4752a0e605f36249ff549f8cccdeb671 net.server: Handle server name (SNI) as extra argument Code added in 75d2874502c3, 9a905888b96c and adc0672b700e uses this field. See #409 and #1408 diff -r 600eee3c4752 -r d4390c427a66 net/server_epoll.lua --- a/net/server_epoll.lua Sun Sep 01 01:55:55 2019 +0200 +++ b/net/server_epoll.lua Sun Sep 01 01:58:38 2019 +0200 @@ -575,6 +575,12 @@ extra = extra; }, interface_mt); + if extra then + if extra.servername then + conn.servername = extra.servername; + end + end + conn:updatenames(); return conn; end diff -r 600eee3c4752 -r d4390c427a66 net/server_event.lua --- a/net/server_event.lua Sun Sep 01 01:55:55 2019 +0200 +++ b/net/server_event.lua Sun Sep 01 01:58:38 2019 +0200 @@ -516,6 +516,7 @@ _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 -r 600eee3c4752 -r d4390c427a66 net/server_select.lua --- a/net/server_select.lua Sun Sep 01 01:55:55 2019 +0200 +++ b/net/server_select.lua Sun Sep 01 01:58:38 2019 +0200 @@ -317,6 +317,9 @@ local handler = bufferqueue -- saves a table ^_^ handler.extra = extra + if extra then + handler.servername = extra.servername + end handler.dispatch = function( ) return dispatch