http: fix compilation with LibreSSL
authorStefan Strogin <stefan.strogin@gmail.com>
Thu, 27 Sep 2018 01:53:29 +0000 (04:53 +0300)
committerTimothy B. Terriberry <tterribe@xiph.org>
Mon, 1 Oct 2018 23:33:30 +0000 (16:33 -0700)
LibreSSL defines OPENSSL_VERSION_NUMBER to 0x20000000L, but its API is
compatible with OpenSSL 1.0.1.
Therefore redefine OPENSSL_VERSION_NUMBER to 0x1000115fL (1.0.1u) if
LibreSSL is used.

Fixes: #2327

src/http.c

index 8ba9b28..bb5645d 100644 (file)
@@ -358,6 +358,11 @@ typedef int op_sock;
 # include <sys/timeb.h>
 # include <openssl/x509v3.h>
 
+# if (defined(LIBRESSL_VERSION_NUMBER)&&OPENSSL_VERSION_NUMBER==0x20000000L)
+#  undef OPENSSL_VERSION_NUMBER
+#  define OPENSSL_VERSION_NUMBER 0x1000115fL
+# endif
+
 /*The maximum number of simultaneous connections.
   RFC 2616 says this SHOULD NOT be more than 2, but everyone on the modern web
    ignores that (e.g., IE 8 bumped theirs up from 2 to 6, Firefox uses 15).