-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make build error with nginx 1.14.2 #167
Comments
Read the
|
have a try, use the command
my.patchdiff --git a/ngx_tcp_core_module.c b/ngx_tcp_core_module.c
index 9e3110d..f1388ba 100644
--- a/ngx_tcp_core_module.c
+++ b/ngx_tcp_core_module.c
@@ -5,6 +5,9 @@
#include <ngx_tcp.h>
#include <nginx.h>
+#ifndef NGX_CONF_MULTI
+#define NGX_CONF_MULTI 0
+#endif
static void *ngx_tcp_core_create_main_conf(ngx_conf_t *cf);
static void *ngx_tcp_core_create_srv_conf(ngx_conf_t *cf);
@@ -481,7 +484,7 @@ ngx_tcp_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
break;
}
- if (ngx_memcmp(ls[i].sockaddr + off, u.sockaddr + off, len) != 0) {
+ if (ngx_memcmp(ls[i].sockaddr + off, ((char*)&u.sockaddr) + off, len) != 0) {
continue;
}
@@ -501,7 +504,7 @@ ngx_tcp_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_memzero(ls, sizeof(ngx_tcp_listen_t));
- ngx_memcpy(ls->sockaddr, u.sockaddr, u.socklen);
+ ngx_memcpy(ls->sockaddr, &u.sockaddr, u.socklen);
ls->socklen = u.socklen;
ls->wildcard = u.wildcard; |
Try the latest branch, thanks @dsugisawa-mixi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nginx_tcp_proxy_module
版本号:./configure --add-module=nginx_tcp_proxy_module-master --with-pcre=pcre-8.42 --with-openssl=openssl-1.0.2q --with-zlib=zlib-1.2.11 --with-poll_module --prefix=/opt/bohui/nginx-1.14.2/run
nginx_tcp_proxy_module-master/ngx_tcp_core_module.c: In function ‘ngx_tcp_core_listen’:
nginx_tcp_proxy_module-master/ngx_tcp_core_module.c:487:9: error: cannot convert to a pointer type
if (ngx_memcmp(ls[i].sockaddr + off, u.sockaddr + off, len) != 0) {
^
nginx_tcp_proxy_module-master/ngx_tcp_core_module.c:507:5: error: incompatible type for argument 2 of ‘memcpy’
ngx_memcpy(ls->sockaddr, u.sockaddr, u.socklen);
^
In file included from src/os/unix/ngx_linux_config.h:27:0,
from src/core/ngx_config.h:26,
from nginx_tcp_proxy_module-master/ngx_tcp_core_module.c:2:
/usr/include/string.h:42:14: note: expected ‘const void * restrict’ but argument is of type ‘ngx_sockaddr_t’
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
^
make[1]: *** [objs/addon/nginx_tcp_proxy_module-master/ngx_tcp_core_module.o] Error 1
make[1]: Leaving directory `/opt/bohui/nginx-1.14.2'
The text was updated successfully, but these errors were encountered: