码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-12-09 01:09:46      阅读:757      评论:0      收藏:0      [点我收藏+]

标签:nginx sticky

报错如下:

/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[1]: *** [objs/addon/nginx-sticky-module-1.1/ngx_http_sticky_misc.o] Error 1

make[1]: Leaving directory `/root/wuxiaoyu/nginx/nginx-1.8.1‘

make: *** [build] 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);




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

标签:nginx sticky

原文地址:http://tenderrain.blog.51cto.com/9202912/1880880

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!