aboutsummaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-01-09 06:19:54 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-01-09 06:19:54 +0100
commit32f719dec7374658c8637a44237879b75984f288 (patch)
treeab72fafe96d763336c1f58c8d39980acf1bacdae /degesch.c
parent0b92e9210cef90a74189ac23a68766636c159fb1 (diff)
downloadxK-32f719dec7374658c8637a44237879b75984f288.tar.gz
xK-32f719dec7374658c8637a44237879b75984f288.tar.xz
xK-32f719dec7374658c8637a44237879b75984f288.zip
degesch: Lua: pass hostname to on_connected
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c6
1 files 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