degesch: Lua: pass hostname to on_connected
This commit is contained in:
parent
0b92e9210c
commit
32f719dec7
|
@ -8410,8 +8410,7 @@ lua_connector_on_connected (void *user_data, int socket, const char *hostname)
|
||||||
{
|
{
|
||||||
struct lua_connector *self = user_data;
|
struct lua_connector *self = user_data;
|
||||||
|
|
||||||
// TODO: use this for SNI once TLS is implemented
|
// TODO: use the hostname for SNI once TLS is implemented
|
||||||
(void) hostname;
|
|
||||||
|
|
||||||
if (self->ref_on_success != LUA_REFNIL)
|
if (self->ref_on_success != LUA_REFNIL)
|
||||||
{
|
{
|
||||||
|
@ -8419,9 +8418,10 @@ lua_connector_on_connected (void *user_data, int socket, const char *hostname)
|
||||||
lua_rawgeti (L, LUA_REGISTRYINDEX, self->ref_on_success);
|
lua_rawgeti (L, LUA_REGISTRYINDEX, self->ref_on_success);
|
||||||
struct lua_connection *connection =
|
struct lua_connection *connection =
|
||||||
lua_plugin_push_connection (self->plugin, socket); // 1: connection
|
lua_plugin_push_connection (self->plugin, socket); // 1: connection
|
||||||
|
lua_pushstring (L, hostname); // 2: hostname
|
||||||
|
|
||||||
struct error *e = NULL;
|
struct error *e = NULL;
|
||||||
if (!lua_plugin_call (self->plugin, 1, 0, &e))
|
if (!lua_plugin_call (self->plugin, 2, 0, &e))
|
||||||
{
|
{
|
||||||
lua_plugin_log_error (self->plugin, "connector on_success", e);
|
lua_plugin_log_error (self->plugin, "connector on_success", e);
|
||||||
// The connection has placed itself in the cache
|
// The connection has placed itself in the cache
|
||||||
|
|
Loading…
Reference in New Issue