httpd: put all headers into environment as HTTP_UPPERCASED_HEADER=val
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 16 Apr 2019 09:37:02 +0000 (11:37 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 16 Apr 2019 09:37:02 +0000 (11:37 +0200)
commitfba665a8889ad7ec20f926bf2719be5c688ed829
tree531b305e8b570f42fb0c4f7a1d3844f165b51669
parentd0ae4103ddca21b7b765347611a9cf33f0cccd74
httpd: put all headers into environment as HTTP_UPPERCASED_HEADER=val

Set up environment variables before running the CGI script.
The variables will be named HTTP_<filtered_name> where the <filtered_name>
is the header name capitalized and all characters not matching
[a-z] | [A-Z] | [0-9] replaced with '_'.

function                                             old     new   delta
http_response                                         80      88      +8
http_response_type                                    20      22      +2
send_headers                                         718     715      -3
parse_conf                                          1481    1478      -3
get_line                                             128     110     -18
cgi_io_loop_and_exit                                 599     569     -30
send_cgi_and_exit                                    882     738    -144
handle_incoming_and_exit                            2793    2592    -201
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/6 up/down: 10/-399)          Total: -389 bytes
   text    data     bss     dec     hex filename
 982178     485    7296  989959   f1b07 busybox_old
 981675     485    7296  989456   f1910 busybox_unstripped

Signed-off-by: Alexander Vickberg <wickbergster@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/httpd.c