]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: lua: missing ifdef related to SSL when enabling LUA
authorBaptiste Assmann <bedis9@gmail.com>
Mon, 2 Mar 2015 20:40:06 +0000 (21:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Mar 2015 12:17:28 +0000 (13:17 +0100)
A couple of ifdef are missing around SSL related functions in LUA.
It prevents from compiling LUA without SSL.
Current patch fix this.

src/hlua.c

index 35253fa1401b81961c948124afed5c926f5d31ff..1df18b66ad54678583e7f63f81f49713a20211db 100644 (file)
@@ -1546,6 +1546,7 @@ __LJMP static int hlua_socket_connect(struct lua_State *L)
        return 0;
 }
 
+#ifdef USE_OPENSSL
 __LJMP static int hlua_socket_connect_ssl(struct lua_State *L)
 {
        struct hlua_socket *socket;
@@ -1555,6 +1556,7 @@ __LJMP static int hlua_socket_connect_ssl(struct lua_State *L)
        socket->s->target = &socket_ssl.obj_type;
        return MAY_LJMP(hlua_socket_connect(L));
 }
+#endif
 
 __LJMP static int hlua_socket_setoption(struct lua_State *L)
 {
@@ -3567,7 +3569,9 @@ void hlua_init(void)
        lua_pushstring(gL.T, "__index");
        lua_newtable(gL.T);
 
+#ifdef USE_OPENSSL
        hlua_class_function(gL.T, "connect_ssl", hlua_socket_connect_ssl);
+#endif
        hlua_class_function(gL.T, "connect",     hlua_socket_connect);
        hlua_class_function(gL.T, "send",        hlua_socket_send);
        hlua_class_function(gL.T, "receive",     hlua_socket_receive);