context: Incidental cleanup

This commit is contained in:
Paul Aurich 2013-06-12 18:36:35 -07:00
parent 9bda3322fb
commit 4c5ce1b177

View File

@ -423,19 +423,21 @@ static int set_verify(lua_State *L)
static int set_options(lua_State *L) static int set_options(lua_State *L)
{ {
int i; int i;
const char *str;
unsigned long flag = 0L; unsigned long flag = 0L;
SSL_CTX *ctx = lsec_checkcontext(L, 1); SSL_CTX *ctx = lsec_checkcontext(L, 1);
int max = lua_gettop(L); int max = lua_gettop(L);
/* any option? */ /* any option? */
if (max > 1) { if (max > 1) {
for (i = 2; i <= max; i++) { for (i = 2; i <= max; i++) {
str = luaL_checkstring(L, i);
#if !defined(SSL_OP_NO_COMPRESSION) && (OPENSSL_VERSION_NUMBER >= 0x0090800f) && (OPENSSL_VERSION_NUMBER < 0x1000000fL) #if !defined(SSL_OP_NO_COMPRESSION) && (OPENSSL_VERSION_NUMBER >= 0x0090800f) && (OPENSSL_VERSION_NUMBER < 0x1000000fL)
/* Version 0.9.8 has a different way to disable compression */ /* Version 0.9.8 has a different way to disable compression */
if (!strcmp(luaL_checkstring(L, i), "no_compression")) if (!strcmp(str, "no_compression"))
ctx->comp_methods = NULL; ctx->comp_methods = NULL;
else else
#endif #endif
if (!set_option_flag(luaL_checkstring(L, i), &flag)) { if (!set_option_flag(str, &flag)) {
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
lua_pushstring(L, "invalid option"); lua_pushstring(L, "invalid option");
return 2; return 2;