yaoweibin / nginx_tcp_proxy_module

add the feature of tcp proxy with nginx, with health check and status monitor
http://yaoweibin.github.com/nginx_tcp_proxy_module
1.64k stars 366 forks source link

expected specifier-qualifier-list before ‘ngx_resolver_addr_t’ #138

Open reynaldliu opened 7 years ago

reynaldliu commented 7 years ago

addrs的定义文件在nginx/src/core/ngx_resolver.h

nginx_tcp_proxy_module的头文件在ngx_tcp_upstream.h的结构体ngx_tcp_upstream_resolved_s中 这是因为在1.9版本起addrs的结构体由ngx_addr_t 改为ngx_resolver_addr_t,如果只是为了安装1.8上,只要直接将ngx_resolver_addr_t改为ngx_addr_t 即可,如果要兼容所有版本,改为下面的代码

if (nginx_version) >= 1005008

if (nginx_version) >= 1009001

ngx_resolver_addr_t *addrs;

else

ngx_addr_t *addrs;

endif

else

in_addr_t *addrs;

endif