Check if macro SSL_OP_NO_COMPRESSION is defined before trying to use it. 62/2862/1
authorDavid Galeano <davidgaleano@turbulenz.biz>
Thu, 10 Jan 2013 02:18:59 +0000 (10:18 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:22 +0000 (13:01 -0800)
lib/libwebsockets.c

index 9601113..086ec8f 100644 (file)
@@ -2729,7 +2729,9 @@ libwebsocket_create_context(int port, const char *interf,
                return NULL;
        }
 
+#ifdef SSL_OP_NO_COMPRESSION
        SSL_CTX_set_options(context->ssl_ctx, SSL_OP_NO_COMPRESSION);
+#endif
        SSL_CTX_set_options(context->ssl_ctx, SSL_OP_CIPHER_SERVER_PREFERENCE);
        SSL_CTX_set_cipher_list(context->ssl_ctx, CIPHERS_LIST_STRING);
 
@@ -2750,7 +2752,9 @@ libwebsocket_create_context(int port, const char *interf,
                        return NULL;
                }
 
+#ifdef SSL_OP_NO_COMPRESSION
                SSL_CTX_set_options(context->ssl_client_ctx, SSL_OP_NO_COMPRESSION);
+#endif
                SSL_CTX_set_options(context->ssl_client_ctx, SSL_OP_CIPHER_SERVER_PREFERENCE);
                SSL_CTX_set_cipher_list(context->ssl_client_ctx, CIPHERS_LIST_STRING);