echo-nginx-module: compile error: ngx_http_connection_t uses ngx_chain_t instead of ngx_buf_t in nginx1.11.10

I haven’t tried with other versions between 1.11.2 (which is the latest version shown in the compatibility section). When we tried to build a package with this included we got:

./modules/echo-nginx-module/src/ngx_http_echo_request_info.c: In function ‘ngx_http_echo_client_request_headers_variable’:
./modules/echo-nginx-module/src/ngx_http_echo_request_info.c:219:15: error: incompatible types when assigning to type ‘ngx_buf_t * {aka struct ngx_buf_s *}’ from type ‘ngx_chain_t {aka struct ngx_chain_s}’
             b = hc->busy[i];
               ^
./modules/echo-nginx-module/src/ngx_http_echo_request_info.c:284:15: error: incompatible types when assigning to type ‘ngx_buf_t * {aka struct ngx_buf_s *}’ from type ‘ngx_chain_t {aka struct ngx_chain_s}’
             b = hc->busy[i];
               ^
objs/Makefile:1849: recipe for target 'objs/addon/src/ngx_http_echo_request_info.o' failed
make: *** [objs/addon/src/ngx_http_echo_request_info.o] Error 1

It seems like they changed it to use an ngx_chain_t instead of an array of buffers https://github.com/openresty/echo-nginx-module/blob/master/src/ngx_http_echo_request_info.c#L180 https://github.com/nginx/nginx/blob/fca26c2e53d46549320a3b23ce0398c5921348dd/src/http/ngx_http_request.h#L312

I think it’s probably as straightforward as changing the type based on NGINX version, but I wasn’t sure if there was more going on there.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Facing same issue on nginx-1.12.0 /home/buildozer/aports/main/nginx/src/echo-nginx-module-0.60/src/ngx_http_echo_request_info.c: In function 'ngx_http_echo_client_request_headers_variable': /home/buildozer/aports/main/nginx/src/echo-nginx-module-0.60/src/ngx_http_echo_request_info.c:219:15: error: incompatible types when assigning to type 'ngx_buf_t * {aka struct ngx_buf_s *}' from type 'ngx_chain_t {aka struct ngx_chain_s}' b = hc->busy[i]; ^ /home/buildozer/aports/main/nginx/src/echo-nginx-module-0.60/src/ngx_http_echo_request_info.c:284:15: error: incompatible types when assigning to type 'ngx_buf_t * {aka struct ngx_buf_s *}' from type 'ngx_chain_t {aka struct ngx_chain_s}' b = hc->busy[i]; ^

@i300220 you can use defanator fork as referenced above until openresty accepts the pull req