From 32f719dec7374658c8637a44237879b75984f288 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sat, 9 Jan 2016 06:19:54 +0100 Subject: degesch: Lua: pass hostname to on_connected --- degesch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/degesch.c b/degesch.c index 11f148d..6aa1667 100644 --- a/degesch.c +++ b/degesch.c @@ -8410,8 +8410,7 @@ lua_connector_on_connected (void *user_data, int socket, const char *hostname) { struct lua_connector *self = user_data; - // TODO: use this for SNI once TLS is implemented - (void) hostname; + // TODO: use the hostname for SNI once TLS is implemented 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); struct lua_connection *connection = lua_plugin_push_connection (self->plugin, socket); // 1: connection + lua_pushstring (L, hostname); // 2: hostname 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); // The connection has placed itself in the cache -- cgit v1.2.3-70-g09d2