OpenIDC / liboauth2

OAuth 2.x and OpenID Connect C library
Apache License 2.0
105 stars 26 forks source link

Building against latest nginx breaks #49

Closed anpin closed 5 months ago

anpin commented 5 months ago

nginx has removed r->port_start and r->port_end.

https://github.com/nginx/nginx/commit/0db94ba96a00ebfc4a3c55af8eaaf20f971a7c4c

src/server/nginx.c: In function '_oauth2_nginx_port_copy':
src/server/nginx.c:103:27: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'port_end'; did you mean 'host_end'?
  103 |         int len = ctx->r->port_end - ctx->r->port_start;
      |                           ^~~~~~~~
      |                           host_end
src/server/nginx.c:103:46: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'port_start'; did you mean 'host_start'?
  103 |         int len = ctx->r->port_end - ctx->r->port_start;
      |                                              ^~~~~~~~~~
      |                                              host_start
src/server/nginx.c:105:58: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'port_start'; did you mean 'host_start'?
  105 |                 v = oauth2_strndup((const char *)ctx->r->port_start, len);
      |                                                          ^~~~~~~~~~
      |                                                          host_start
make: *** [Makefile:1464: src/server/liboauth2_nginx_la-nginx.lo] Error 1
anpin commented 5 months ago

@zandbelt thank you for the swift response

zandbelt commented 5 months ago

this needed another fix (the remote port was used instead of the local one...) ; that is in a new release 1.6.2 now