mirror of
https://github.com/brunoos/luasec.git
synced 2024-12-27 04:58:20 +01:00
Merge pull request #63 from gleydsonsoares/tweak-OPENSSL_NO_COMP
simplify OPENSSL_NO_COMP guard
This commit is contained in:
commit
31b7a4744b
@ -412,7 +412,9 @@ static int meth_want(lua_State *L)
|
|||||||
*/
|
*/
|
||||||
static int meth_compression(lua_State *L)
|
static int meth_compression(lua_State *L)
|
||||||
{
|
{
|
||||||
#if !defined(OPENSSL_NO_COMP)
|
#ifdef OPENSSL_NO_COMP
|
||||||
|
const void *comp;
|
||||||
|
#else
|
||||||
const COMP_METHOD *comp;
|
const COMP_METHOD *comp;
|
||||||
#endif
|
#endif
|
||||||
p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection");
|
p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection");
|
||||||
@ -421,15 +423,11 @@ static int meth_compression(lua_State *L)
|
|||||||
lua_pushstring(L, "closed");
|
lua_pushstring(L, "closed");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
#if !defined(OPENSSL_NO_COMP)
|
|
||||||
comp = SSL_get_current_compression(ssl->ssl);
|
comp = SSL_get_current_compression(ssl->ssl);
|
||||||
if (comp)
|
if (comp)
|
||||||
lua_pushstring(L, SSL_COMP_get_name(comp));
|
lua_pushstring(L, SSL_COMP_get_name(comp));
|
||||||
else
|
else
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
#else
|
|
||||||
lua_pushnil(L);
|
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user