context: Add no_compression for OpenSSL 0.9.8 as well default tip

Sat, 17 Dec 2011 10:30:58 -0800

author
Paul Aurich <paul@darkrain42.org>
date
Sat, 17 Dec 2011 10:30:58 -0800
changeset 45
5be249c0ae71
parent 44
b3a0d23e5b20

context: Add no_compression for OpenSSL 0.9.8 as well

Since OpenSSL 0.9.8 doesn't have SSL_OP_NO_COMPRESSION, this is
implemented by simplying NULLing out the SSL_CTX->comp_methods stack.

src/context.c file | annotate | diff | comparison | revisions
--- a/src/context.c	Tue Jul 05 18:12:17 2011 -0700
+++ b/src/context.c	Sat Dec 17 10:30:58 2011 -0800
@@ -538,6 +538,14 @@
   /* any option? */
   if (max > 1) {
     for (i = 2; i <= max; i++) {
+#if !defined(SSL_OP_NO_COMPRESSION)
+      /* Manually disable compression if built against an older
+       * OpenSSL which doesn't have SSL_OP_NO_COMPRESSION
+       */
+      if (!strcmp(luaL_checkstring(L, i), "no_compression")) {
+        ctx->comp_methods = NULL;
+      } else
+#endif
       if (!set_option_flag(luaL_checkstring(L, i), &flag)) {
         lua_pushboolean(L, 0);
         lua_pushstring(L, "invalid option");

mercurial