Bug 270970 - www/nginx: compile error /mod_zip-5b2604b/ngx_http_zip_headers.c
Summary: www/nginx: compile error /mod_zip-5b2604b/ngx_http_zip_headers.c
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-21 01:19 UTC by Please
Modified: 2023-09-01 19:53 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (joneum)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Please 2023-04-21 01:19:25 UTC
Nginx is using an old version (5b2604b) of mod_zip for compilation:

https://cgit.freebsd.org/ports/tree/www/nginx/Makefile.extmod#n211

The latest (39dc908) is here: https://github.com/evanmiller/mod_zip/commit/39dc9085d29445ed3238d215e94fbcbeef0131dc


Unfortunately, I do not know if that fixes the error below:


```
/wrkdirs/usr/ports/www/nginx/work/mod_zip-5b2604b/ngx_http_zip_headers.c:59:39: error: member reference type 'ngx_table_elt_t *' (aka 'struct ngx_table_elt_s *') is a pointer; did you mean to use '->'?
    ccp = r->headers_out.cache_control.elts;
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
                                      ->
/wrkdirs/usr/ports/www/nginx/work/mod_zip-5b2604b/ngx_http_zip_headers.c:59:40: error: no member named 'elts' in 'struct ngx_table_elt_s'
    ccp = r->headers_out.cache_control.elts;
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/wrkdirs/usr/ports/www/nginx/work/mod_zip-5b2604b/ngx_http_zip_headers.c:62:28: warning: incompatible pointer types passing 'ngx_table_elt_t **' (aka 'struct ngx_table_elt_s **') to parameter of type 'ngx_array_t *' [-Wincompatible-pointer-types]
        if (ngx_array_init(&r->headers_out.cache_control, r->pool,
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/ngx_array.h:32:29: note: passing argument to parameter 'array' here
ngx_array_init(ngx_array_t *array, ngx_pool_t *pool, ngx_uint_t n, size_t size)
                            ^
/wrkdirs/usr/ports/www/nginx/work/mod_zip-5b2604b/ngx_http_zip_headers.c:69:30: warning: incompatible pointer types passing 'ngx_table_elt_t **' (aka 'struct ngx_table_elt_s **') to parameter of type 'ngx_array_t *' [-Wincompatible-pointer-types]
        ccp = ngx_array_push(&r->headers_out.cache_control);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/ngx_array.h:27:35: note: passing argument to parameter 'a' here
void *ngx_array_push(ngx_array_t *a);
                                  ^
/wrkdirs/usr/ports/www/nginx/work/mod_zip-5b2604b/ngx_http_zip_headers.c:85:53: error: member reference type 'ngx_table_elt_t *' (aka 'struct ngx_table_elt_s *') is a pointer; did you mean to use '->'?
        for (i = 1; i < r->headers_out.cache_control.nelts; i++) {
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
                                                    ->
/wrkdirs/usr/ports/www/nginx/work/mod_zip-5b2604b/ngx_http_zip_headers.c:85:54: error: no member named 'nelts' in 'struct ngx_table_elt_s'
        for (i = 1; i < r->headers_out.cache_control.nelts; i++) {
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/wrkdirs/usr/ports/www/nginx/work/mod_zip-5b2604b/ngx_http_zip_headers.c:329:65: error: too few arguments to function call, expected 5, have 4
    return ngx_http_variable_unknown_header(v, var, part, prefix);
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     ^
src/http/ngx_http_variables.h:60:11: note: 'ngx_http_variable_unknown_header' declared here
ngx_int_t ngx_http_variable_unknown_header(ngx_http_request_t *r,
          ^
2 warnings and 5 errors generated.
```
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-09-01 19:52:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b0b3e488f56e0899977a8e2e184a7338f3f6a2ae

commit b0b3e488f56e0899977a8e2e184a7338f3f6a2ae
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2023-09-01 19:48:36 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2023-09-01 19:51:55 +0000

    www/nginx: Update 3rd party module

    switch the 3rd party module zip to evanmiller. This project is more
    active than vince2678

    PR:     270970

    Sponsored by: Netzkommune GmbH

 www/nginx/Makefile        | 2 +-
 www/nginx/Makefile.extmod | 2 +-
 www/nginx/distinfo        | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)