zhangbinmy 发表于 2018-11-8 10:09:07

nginx编译安装nginx-sticky-module报错

  报错如下:
  /usr/local/nginx-sticky-module-1.1/nginx-sticky-module-1.1/ngx_http_sticky_misc.c: In function ‘ngx_http_sticky_misc_text_raw’:
  /usr/local/nginx-sticky-module-1.1/nginx-sticky-module-1.1/ngx_http_sticky_misc.c:281:2: error: passing argument 2 of ‘ngx_sock_ntop’ makes integer from pointer without a cast [-Werror]
  src/core/ngx_inet.h:110:8: note: expected ‘socklen_t’ but argument is of type ‘u_char *’
  /usr/local/nginx-sticky-module-1.1/nginx-sticky-module-1.1/ngx_http_sticky_misc.c:281:2: error: passing argument 3 of ‘ngx_sock_ntop’ makes pointer from integer without a cast [-Werror]
  src/core/ngx_inet.h:110:8: note: expected ‘u_char *’ but argument is of type ‘size_t’
  /usr/local/nginx-sticky-module-1.1/nginx-sticky-module-1.1/ngx_http_sticky_misc.c:281:2: error: too few arguments to function ‘ngx_sock_ntop’
  src/core/ngx_inet.h:110:8: note: declared here
  cc1: all warnings being treated as errors
  make: *** Error 1
  make: Leaving directory `/root/wuxiaoyu/nginx/nginx-1.8.1'
  make: *** Error 2
  root@wuxy-it-mail-dns:~/wuxiaoyu/nginx/nginx-1.8.1#
解决方法
  进入nginx-sticky-module-1.1解压之后的文件夹
  vim ngx_http_sticky_misc.c+281
  原来:
  digest->len = ngx_sock_ntop(in, digest->data, len, 1);
  改成:
  digest->len =ngx_sock_ntop(in,sizeof(struct sockaddr_in),digest->data, len, 1);

页: [1]
查看完整版本: nginx编译安装nginx-sticky-module报错