[PATCH v3] httpd: Pass custom HTTP headers to CGI scripts

Xabier Oneca -- xOneca xoneca at gmail.com
Fri Apr 5 19:33:28 UTC 2019


Hi Alex,

Thank you for your time. Here are two more comments about your new
patch (now that I can see the full code at work):

You could use 'continue' instead of 'header_matched' variable. I think
it is more clear and less code.

Also, here:

> +                /* Insert new header into header list */
> +                if (!G.hdr_list) {
> +                    G.hdr_list = cur;
> +                    cur->next = G.hdr_list;
> +                    last = cur;
> +                } else {
> +                    cur->next = G.hdr_list;
> +                    last->next = cur;
> +                    last = cur;
> +                }

You can take 'cur->next = G.hdr_list;' and 'last = cur' out of the
conditional branches. They are always executed whatever happens.

Cheers,

Xabier Oneca_,,_


More information about the busybox mailing list