Skip to content

Conversation

@charlesportwoodii
Copy link

Hi,

In Nginx 1.9.11, the ngx_udp_connection_t structure has been renamed to ngx_resolver_connection_t in src/core/ngx_resolver.h of Nginx core. (nginx/nginx@1945fff).

Consequently, compilation fails in lua-nginx-module/src/ngx_http_lua_socket_udp.h and lua-nginx-module/src/ngx_http_lua_socket_udp.c due to references of ngx_udp_connection_t. The compilation failure is as follows:

modules/lua-nginx-module/src/ngx_http_lua_util.c
In file included from modules/lua-nginx-module/src/ngx_http_lua_util.c:38:0:
modules/lua-nginx-module/src/ngx_http_lua_socket_udp.h:34:5: error: unknown type name ‘ngx_udp_connection_t’
     ngx_udp_connection_t             udp_connection;

I've attached a simple patch that corrects the issue and allows Nginx 1.9.11 to compile.


UPDATE: See #668 for others reporting this issue.

@charlesportwoodii charlesportwoodii changed the title Renames ngx_udp_connection_t references to ngx_resolver_connection_t … Nginx 1.9.11 ngx_udp_connection_t => ngx_resolver_connection_t Feb 9, 2016
@charlesportwoodii charlesportwoodii force-pushed the ngx_resolver_connection_t branch from ff7b208 to 0a139ff Compare February 9, 2016 18:17
@nzt4567
Copy link

nzt4567 commented Feb 9, 2016

Great work!

ngx_int_t rc;
ngx_http_lua_loc_conf_t *llcf;
ngx_udp_connection_t *uc;
ngx_resolver_connection_t *uc;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: the identifier names should be aligned up vertically. I think the ngx-releng tool in the nginx-devel-utils repos automatically catches coding style issues like this:

https://github.com/openresty/nginx-devel-utils

Will you please run this tool and fix any coding style issues? Thanks!

@charlesportwoodii charlesportwoodii force-pushed the ngx_resolver_connection_t branch from cc8ccc2 to 1cbed77 Compare February 9, 2016 22:28
…for Nginx 1.9.11

Nginx 1.9.11 (nginx/nginx@1945fff) changes the resolver connection type to support TCP connections
This change brings lua-nginx-module up to date with that change.
@charlesportwoodii charlesportwoodii force-pushed the ngx_resolver_connection_t branch from 1cbed77 to 8a63903 Compare February 9, 2016 22:31
@charlesportwoodii
Copy link
Author

@agentzh,

Sorry about the style. I've rebased an update that has the alignment issues correct.

Changes in this rebase:

  • Changed connection back to udp_connection
  • Styles

I'm not exactly sure what should be done regarding ngx_resolver_connection_t. In Nginx core, ngx_udp_connection_t was simply renamed to ngx_resolver_connection_t with some slight variation to the struct (connection was renamed to udp).

It may be beneficial to to create something like a ngx_http_lua_udp_connection_t struct, as that would be an easier place to put the macros in. My C is a little bit rusty though, and I just whipped this up to get Nginx to compile again. I'll try playing around with creating a re-usable and backwards compatible struct.

@agentzh
Copy link
Member

agentzh commented Feb 9, 2016

@charlesportwoodii Thanks for your work on this. I'll continue thinking about the details here.

@charlesportwoodii
Copy link
Author

@agentzh,

Glad to help out what little I can. Sorry for not being much more useful than this though. Preprocessor macros will be a pretty simple solution for the backwards compatibility aspect, but that would make a mess of src/ngx_http_lua_socket_udp.c and I wanted to avoid that as much as possible.

Let me know if I can help out in any other way.

@agentzh
Copy link
Member

agentzh commented Feb 9, 2016

@charlesportwoodii Thanks for your help so far :) I'll look into this in the next couple of weeks. The next OpenResty release will be based on NGINX 1.9.11 anyway.

agentzh added a commit that referenced this pull request Feb 11, 2016
…. Portwood II and Tomas Kvasnicka for the report in #669 and #668, respectively.
@agentzh
Copy link
Member

agentzh commented Feb 11, 2016

The compilation error should be gone now. Thanks for the report!

@agentzh agentzh closed this Feb 11, 2016
sophomeric pushed a commit to researchgate/nginx that referenced this pull request Feb 11, 2016
denji added a commit to denji/homebrew-nginx that referenced this pull request Feb 12, 2016
bugfix: fixed compilation errors with nginx 1.9.11+.

Thanks Charles R. Portwood II and Tomas Kvasnicka for the report in
openresty/lua-nginx-module#669 and openresty/lua-nginx-module#668,
respectively.
denji added a commit to denji/homebrew-nginx that referenced this pull request Feb 12, 2016
bugfix: fixed compilation errors with nginx 1.9.11+.

Thanks Charles R. Portwood II and Tomas Kvasnicka for the report in
openresty/lua-nginx-module#669 and openresty/lua-nginx-module#668,
respectively.
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

Successfully merging this pull request may close these issues.

3 participants