Skip to content

Commit e299d8e

Browse files
authored
Merge pull request fdintino#96 from unlim2/2.2
Fix for compiling with nginx > 1.11.2
2 parents aba1e3f + 0dba646 commit e299d8e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

config

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
USE_MD5=YES
22
USE_SHA1=YES
3+
USE_OPENSSL=YES
34
ngx_addon_name=ngx_http_upload_module
45
HTTP_MODULES="$HTTP_MODULES ngx_http_upload_module"
56
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_upload_module.c"

ngx_http_upload_module.c

+19
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@
88
#include <ngx_http.h>
99
#include <nginx.h>
1010

11+
#if nginx_version >= 1011002
12+
13+
#include <ngx_md5.h>
14+
15+
typedef ngx_md5_t MD5_CTX;
16+
17+
#define MD5Init ngx_md5_init
18+
#define MD5Update ngx_md5_update
19+
#define MD5Final ngx_md5_final
20+
21+
#define MD5_DIGEST_LENGTH 16
22+
23+
#include <openssl/sha.h>
24+
25+
#else
26+
1127
#if (NGX_HAVE_OPENSSL_MD5_H)
1228
#include <openssl/md5.h>
1329
#else
@@ -26,6 +42,9 @@
2642
#include <sha.h>
2743
#endif
2844

45+
46+
#endif
47+
2948
#define MULTIPART_FORM_DATA_STRING "multipart/form-data"
3049
#define BOUNDARY_STRING "boundary="
3150
#define CONTENT_DISPOSITION_STRING "Content-Disposition:"

0 commit comments

Comments
 (0)