dannote / socks-nginx-module

An nginx_http_proxy_module fork with SOCKS5 support
196 stars 65 forks source link

Compilation fails on debian jessie #1

Closed thestanislav closed 7 years ago

thestanislav commented 8 years ago

Hello. I am trying to rebuild nginx package with the socks module support, but have some errors (

/home/thestanislav/nginx/nginx-1.6.2/debian/modules/socks-nginx-module/src/ngx_http_socks_module.c:3898:26: warning: assignment makes pointer from integer without a cast
     slcf->upstream.cache = 1;
                          ^
/home/thestanislav/nginx/nginx-1.6.2/debian/modules/socks-nginx-module/src/ngx_http_socks_module.c:3912:23: error: ‘ngx_http_upstream_conf_t’ has no member named ‘cache_value’
         slcf->upstream.cache_value = ngx_palloc(cf->pool,
                       ^
/home/thestanislav/nginx/nginx-1.6.2/debian/modules/socks-nginx-module/src/ngx_http_socks_module.c:3914:27: error: ‘ngx_http_upstream_conf_t’ has no member named ‘cache_value’
         if (slcf->upstream.cache_value == NULL) {
                           ^
/home/thestanislav/nginx/nginx-1.6.2/debian/modules/socks-nginx-module/src/ngx_http_socks_module.c:3918:24: error: ‘ngx_http_upstream_conf_t’ has no member named ‘cache_value’
         *slcf->upstream.cache_value = cv;
                        ^
/home/thestanislav/nginx/nginx-1.6.2/debian/modules/socks-nginx-module/src/ngx_http_socks_module.c:3918:37: error: incompatible types when assigning to type ‘ngx_command_t’ from type ‘ngx_http_complex_value_t’
         *slcf->upstream.cache_value = cv;
                                     ^
/home/thestanislav/nginx/nginx-1.6.2/debian/modules/socks-nginx-module/src/ngx_http_socks_module.c:3923:19: error: ‘ngx_http_upstream_conf_t’ has no member named ‘cache_zone’
     slcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0,
                   ^
/home/thestanislav/nginx/nginx-1.6.2/debian/modules/socks-nginx-module/src/ngx_http_socks_module.c:3925:23: error: ‘ngx_http_upstream_conf_t’ has no member named ‘cache_zone’
dannote commented 8 years ago

Hello! I didn't test it for anything other than 1.9.7 yet.

dannote commented 8 years ago

Some refactoring was done since that version. I'll try to add version-specific preprocessing stuff.

https://github.com/nginx/nginx/commit/7817df480eb4b3ddee56129b67b1fb697b367861 https://github.com/nginx/nginx/commit/c40a72761c909aca80fb27d9df12fa3043afbaa2

dannote commented 8 years ago

You can use --without-http-cache option as temporary workaround.

thestanislav commented 8 years ago

Still getting error with 1.9.4

/home/thestanislav/nginx/nginx-1.9.4/debian/modules/socks-nginx-module/src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_init_connection’:
/home/thestanislav/nginx/nginx-1.9.4/debian/modules/socks-nginx-module/src/ngx_http_socks_upstream.c:1309:6: error: ‘ngx_http_upstream_t’ has no member named ‘request_all_sent’
     u->request_all_sent = 0;
      ^
/home/thestanislav/nginx/nginx-1.9.4/debian/modules/socks-nginx-module/src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_send_request’:
/home/thestanislav/nginx/nginx-1.9.4/debian/modules/socks-nginx-module/src/ngx_http_socks_upstream.c:1475:6: error: ‘ngx_http_upstream_t’ has no member named ‘request_all_sent’
     u->request_all_sent = 1;
      ^
/home/thestanislav/nginx/nginx-1.9.4/debian/modules/socks-nginx-module/src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_send_request_handler’:
/home/thestanislav/nginx/nginx-1.9.4/debian/modules/socks-nginx-module/src/ngx_http_socks_upstream.c:1639:10: error: ‘ngx_http_upstream_t’ has no member named ‘request_all_sent’

Can you post your configuration options?

dannote commented 8 years ago

Damn it. This member was also added around 1.9.2. Please then try 1.9.7 until the patch released.

tilman commented 7 years ago

Same error for me. Using Centos 7.2 and nginx-1.9.7:

...

cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail -I src/stream \
    -o objs/addon/src/ngx_http_socks_upstream.o \
    src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_init_connection’:
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c:1309:6: error: ‘ngx_http_upstream_t’ has no member named ‘request_all_sent’
     u->request_all_sent = 0;
      ^
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_send_request’:
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c:1475:6: error: ‘ngx_http_upstream_t’ has no member named ‘request_all_sent’
     u->request_all_sent = 1;
      ^
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_send_request_handler’:
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c:1639:10: error: ‘ngx_http_upstream_t’ has no member named ‘request_all_sent’
     if (u->request_all_sent) {
          ^
make[1]: *** [objs/addon/src/ngx_http_socks_upstream.o] Error 1
make[1]: Leaving directory `/root/nginx-1.9.7'
make: *** [build] Error 2

Tried with config option '--without-http-cache' and without: ./configure --add-module=src/http/modules/ngx_http_socks_module/ --user=nobody --group=nobody --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --without-http-cache

Any Tips how to solve my problem?

dannote commented 7 years ago

@tilman I've merged ee213a0 to fix that.

tilman commented 7 years ago

Same problem now with request_body_sent

cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail -I src/stream \
    -o objs/addon/src/ngx_http_socks_upstream.o \
    src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_init_connection’:
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c:1309:6: error: ‘ngx_http_upstream_t’ has no member named ‘request_body_sent’
     u->request_body_sent = 0;
      ^
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_send_request’:
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c:1475:6: error: ‘ngx_http_upstream_t’ has no member named ‘request_body_sent’
     u->request_body_sent = 1;
      ^
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c: In function ‘ngx_http_socks_upstream_send_request_handler’:
src/http/modules/ngx_http_socks_module//src/ngx_http_socks_upstream.c:1639:10: error: ‘ngx_http_upstream_t’ has no member named ‘request_body_sent’
     if (u->request_body_sent) {
          ^
make[1]: *** [objs/addon/src/ngx_http_socks_upstream.o] Error 1
make[1]: Leaving directory `/root/nginx-1.9.7'
make: *** [build] Error 2
dannote commented 7 years ago

Replacing request_body_sent to request_sent should fix this issue. I'll test the module against different nginx versions later today. I suppose that we won't support anything before 1.9 branch and will focus on stable and mainline versions.

tilman commented 7 years ago

Great. Compiled fine now! Thanks