Compatibility issues with Nginx 1.13.1

Issue #39 new
Sean Zachary Owen Marciniak created an issue

I have forked this project under my own handle to try work on this issue on my own but I appear to be hitting a road block.

https://bitbucket.org/LeMovieStoreGuy/nginx-sticky-module-ng/src/master/

These are are the following changes I have made so far:

diff --git config config
index bf9bacc..e17f351 100644
--- config
+++ config
@@ -1,6 +1,17 @@
 ngx_addon_name=ngx_http_sticky_module
-HTTP_MODULES="$HTTP_MODULES ngx_http_sticky_module"
-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_sticky_module.c $ngx_addon_dir/ngx_http_sticky_misc.c"
-NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/ngx_http_sticky_misc.h"
-USE_MD5=YES
-USE_SHA1=YES
+
+if test -n "$ngx_module_link"; then
+  ngx_module_type=HTTP
+  ngx_module_name=ngx_http_sticky_module
+  ngx_module_src="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_sticky_module.c $ngx_addon_dir/ngx_http_sticky_misc.c"
+  ngx_module_deps="$NGX_ADDON_DEPS $ngx_addon_dir/ngx_http_sticky_misc.h"
+  ngx_module_libs="$CORE_LIBS -lssl"
+  . auto/module
+else
+  HTTP_MODULES="$HTTP_MODULES ngx_http_sticky_module"
+  NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_sticky_module.c $ngx_addon_dir/ngx_http_sticky_misc.c"
+  NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/ngx_http_sticky_misc.h"
+  USE_MD5=YES
+  USE_SHA1=YES
+  CORE_LIBS="$CORE-lssl -lssl"
+fi
diff --git ngx_http_sticky_misc.c ngx_http_sticky_misc.c
index 0a3548c..fa230ca 100644
--- ngx_http_sticky_misc.c
+++ ngx_http_sticky_misc.c
@@ -9,6 +9,8 @@
 #include <ngx_http.h>
 #include <ngx_md5.h>
 #include <ngx_sha1.h>
+#include <openssl/sha.h>
+#include <openssl/md5.h>

 #include "ngx_http_sticky_misc.h"

@@ -359,4 +361,3 @@ ngx_int_t ngx_http_sticky_misc_text_sha1(ngx_pool_t *pool, struct sockaddr *in,

   return ngx_pfree(pool, &str);
 }
-

However, even though these changes have been made based on suggestions on other issues, I keep getting a compile time issue that I am not sure how to resolve.

objs/ngx_modules.o:(.data.rel+0x180): undefined reference to `ngx_http_sticky_module'
collect2: error: ld returned 1 exit status

If anyone has some advice on how to resolve this, it would be greatly appreciated.

Comments (1)

  1. Jarosław Dyląg

    You have got typo in variable ngx_module_srcs name.

    Replace

    ngx_module_src="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_sticky_module.c $ngx_addon_dir/ngx_http_sticky_misc.c"
    

    with

    ngx_module_srcs="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_sticky_module.c $ngx_addon_dir/ngx_http_sticky_misc.c"
    
  2. Log in to comment