nginx-upload-progress-module icon indicating copy to clipboard operation
nginx-upload-progress-module copied to clipboard

Compilation fails with Nginx 1.23

Open csandanov opened this issue 2 years ago • 5 comments

Trying to compile as a dynamic module from master branch on Alpine Linux 3.15:

	objs/ngx_http_uploadprogress_module_modules.c
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c: In function 'ngx_http_reportuploads_handler':
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:649:39: error: 'r->headers_out.cache_control' is a pointer; did you mean to use '->'?
  649 |     ccp = r->headers_out.cache_control.elts;
      |                                       ^
      |                                       ->
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:652:28: error: passing argument 1 of 'ngx_array_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
  652 |         if (ngx_array_init(&r->headers_out.cache_control, r->pool,
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            ngx_table_elt_t ** {aka struct ngx_table_elt_s **}
In file included from src/core/ngx_core.h:65,
                 from /tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:8:
src/core/ngx_array.h:32:29: note: expected 'ngx_array_t *' but argument is of type 'ngx_table_elt_t **' {aka 'struct ngx_table_elt_s **'}
   32 | ngx_array_init(ngx_array_t *array, ngx_pool_t *pool, ngx_uint_t n, size_t size)
      |                ~~~~~~~~~~~~~^~~~~
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:658:30: error: passing argument 1 of 'ngx_array_push' from incompatible pointer type [-Werror=incompatible-pointer-types]
  658 |         ccp = ngx_array_push(&r->headers_out.cache_control);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              ngx_table_elt_t ** {aka struct ngx_table_elt_s **}
In file included from src/core/ngx_core.h:65,
                 from /tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:8:
src/core/ngx_array.h:27:35: note: expected 'ngx_array_t *' but argument is of type 'ngx_table_elt_t **' {aka 'struct ngx_table_elt_s **'}
   27 | void *ngx_array_push(ngx_array_t *a);
      |                      ~~~~~~~~~~~~~^
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:675:53: error: 'r->headers_out.cache_control' is a pointer; did you mean to use '->'?
  675 |         for (i = 1; i < r->headers_out.cache_control.nelts; i++) {
      |                                                     ^
      |                                                     ->
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:2047: objs/addon/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/tmp/nginx-1.23.0'
make: *** [Makefile:10: build] Error 2

csandanov avatar Jun 22 '22 16:06 csandanov

Can confirm the patch above works for me.

plinss avatar Jun 26 '22 01:06 plinss

Works for me too, thank you @mayson, you should submit a PR

csandanov avatar Jun 27 '22 06:06 csandanov

Same fail on latest release 1.24

sergey-dryabzhinsky avatar Apr 12 '23 10:04 sergey-dryabzhinsky

1.24 builds fine using https://github.com/masterzen/nginx-upload-progress-module/compare/master...msva:nginx-upload-progress-module:master.diff

andypost avatar Apr 12 '23 11:04 andypost

Thank you @mayson it works also with nginx-1.24.0 and nginx-1.26.0

naurissteins avatar May 20 '24 21:05 naurissteins

It would be great if someone would send me a PR, I could merge it officially.

masterzen avatar May 21 '24 18:05 masterzen

Any other issues with an existing patch I should take a look for creating a PR?

BenBE avatar May 22 '24 18:05 BenBE

@masterzen Would you mind creating a new release for this change?

DimitriosLisenko avatar Jun 26 '24 17:06 DimitriosLisenko

@masterzen Would you mind creating a new release for this change?

Done, I created v0.9.3. Since I haven't done so in ages, let me know if there's anything not working :)

masterzen avatar Jun 29 '24 10:06 masterzen