Skip to content

Commit

Permalink
Merge pull request fdintino#96 from unlim2/2.2
Browse files Browse the repository at this point in the history
Fix for compiling with nginx > 1.11.2
  • Loading branch information
fdintino authored Mar 9, 2018
2 parents aba1e3f + 0dba646 commit e299d8e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions config
Original file line number Diff line number Diff line change
@@ -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"
19 changes: 19 additions & 0 deletions ngx_http_upload_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@
#include <ngx_http.h>
#include <nginx.h>

#if nginx_version >= 1011002

#include <ngx_md5.h>

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 <openssl/sha.h>

#else

#if (NGX_HAVE_OPENSSL_MD5_H)
#include <openssl/md5.h>
#else
Expand All @@ -26,6 +42,9 @@
#include <sha.h>
#endif


#endif

#define MULTIPART_FORM_DATA_STRING "multipart/form-data"
#define BOUNDARY_STRING "boundary="
#define CONTENT_DISPOSITION_STRING "Content-Disposition:"
Expand Down

0 comments on commit e299d8e

Please sign in to comment.