From 0dba646a00ae624d2d6c30d5d5f8d54196af1f03 Mon Sep 17 00:00:00 2001 From: unlim2 <246047@mail.com> Date: Wed, 20 Sep 2017 10:49:01 +0300 Subject: [PATCH] Fix for compiling with nginx > 1.11.2 --- config | 1 + ngx_http_upload_module.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/config b/config index a6819e5..e84727a 100644 --- a/config +++ b/config @@ -1,5 +1,6 @@ USE_MD5=YES USE_SHA1=YES +USE_OPENSSL=YES ngx_addon_name=ngx_http_upload_module HTTP_MODULES="$HTTP_MODULES ngx_http_upload_module" NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_upload_module.c" diff --git a/ngx_http_upload_module.c b/ngx_http_upload_module.c index 93ded70..42afd41 100644 --- a/ngx_http_upload_module.c +++ b/ngx_http_upload_module.c @@ -8,6 +8,22 @@ #include #include +#if nginx_version >= 1011002 + +#include + +typedef ngx_md5_t MD5_CTX; + +#define MD5Init ngx_md5_init +#define MD5Update ngx_md5_update +#define MD5Final ngx_md5_final + +#define MD5_DIGEST_LENGTH 16 + +#include + +#else + #if (NGX_HAVE_OPENSSL_MD5_H) #include #else @@ -26,6 +42,9 @@ #include #endif + +#endif + #define MULTIPART_FORM_DATA_STRING "multipart/form-data" #define BOUNDARY_STRING "boundary=" #define CONTENT_DISPOSITION_STRING "Content-Disposition:"