Skip to content
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

Does not build against nginx as of mid-2017 #34

Open
jrwren opened this issue Oct 21, 2021 · 1 comment
Open

Does not build against nginx as of mid-2017 #34

jrwren opened this issue Oct 21, 2021 · 1 comment

Comments

@jrwren
Copy link

jrwren commented Oct 21, 2021

Author: Eran Kornblau erankor@gmail.com
Date: Thu Mar 2 08:46:00 2017 -0500

Added missing static specifiers.

As of the above commit, the ngx_udp_connect function is static (not exported) and so cannot be used by this library.

I don't know of a good fix, but if some suggests one to me I will attempt to implement it.

Currently I'm applying this patch to my nginx build.

diff -ru nginx-1.18.0/src/core/ngx_resolver.c nginx-1.18.0-jrw/src/core/ngx_resolver.c
--- nginx-1.18.0/src/core/ngx_resolver.c	2020-04-21 14:09:01.000000000 +0000
+++ nginx-1.18.0-jrw/src/core/ngx_resolver.c	2021-10-21 15:42:19.808367999 +0000
@@ -56,7 +56,7 @@
         ((u_char *) (n) - offsetof(ngx_resolver_node_t, node))
 
 
-static ngx_int_t ngx_udp_connect(ngx_resolver_connection_t *rec);
+ngx_int_t ngx_udp_connect(ngx_resolver_connection_t *rec);
 static ngx_int_t ngx_tcp_connect(ngx_resolver_connection_t *rec);
 
 
@@ -4397,7 +4397,7 @@
 }
 
 
-static ngx_int_t
+ngx_int_t
 ngx_udp_connect(ngx_resolver_connection_t *rec)
 {
     int                rc;

@lord-asmo
Copy link

A bit fixed for 1.22

diff -r 29ba1d6a2da9 -r 2906f12bacd3 src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c	Tue Apr 04 18:01:57 2017 +0300
+++ b/src/core/ngx_resolver.c	Tue Apr 11 17:37:26 2017 +0200
@@ -56,8 +56,4 @@

-static ngx_int_t ngx_udp_connect(ngx_resolver_connection_t *rec);
-static ngx_int_t ngx_tcp_connect(ngx_resolver_connection_t *rec);
-
-
 static void ngx_resolver_cleanup(void *data);
 static void ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree);
 static ngx_int_t ngx_resolve_name_locked(ngx_resolver_t *r,
@@ -4379,7 +4375,7 @@
 }
 
 
-static ngx_int_t
+ngx_int_t
 ngx_udp_connect(ngx_resolver_connection_t *rec)
 {
     int                rc;
@@ -4463,7 +4459,7 @@
 }
 
 
-static ngx_int_t
+ngx_int_t
 ngx_tcp_connect(ngx_resolver_connection_t *rec)
 {
     int                rc;
diff -r 29ba1d6a2da9 -r 2906f12bacd3 src/core/ngx_resolver.h
--- a/src/core/ngx_resolver.h	Tue Apr 04 18:01:57 2017 +0300
+++ b/src/core/ngx_resolver.h	Tue Apr 11 17:37:26 2017 +0200
@@ -235,4 +235,8 @@
 char *ngx_resolver_strerror(ngx_int_t err);
 
 
+ngx_int_t ngx_udp_connect(ngx_resolver_connection_t *rec);
+ngx_int_t ngx_tcp_connect(ngx_resolver_connection_t *rec);
+
+
 #endif /* _NGX_RESOLVER_H_INCLUDED_ */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants