diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-10-30 14:32:05 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-10-30 16:49:45 +0300 |
commit | 8c644fc1f4d498ea489add8d40a68f5d3e5899fa (patch) | |
tree | c2189b645575d323a806bb49554c30e81067daa3 /contrib | |
parent | 22300a5257849092ad9e2addceccaa0e99392c19 (diff) | |
download | libmicrohttpd-8c644fc1f4d498ea489add8d40a68f5d3e5899fa.tar.gz libmicrohttpd-8c644fc1f4d498ea489add8d40a68f5d3e5899fa.zip |
Updated HTTP statuses
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/gen_http_statuses_inserts.sh | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/gen_http_statuses_inserts.sh b/contrib/gen_http_statuses_inserts.sh index 3a7dedb1..a4f2bb01 100755 --- a/contrib/gen_http_statuses_inserts.sh +++ b/contrib/gen_http_statuses_inserts.sh | |||
@@ -4,7 +4,7 @@ | |||
4 | # Generate code and header inserts for HTTP statues | 4 | # Generate code and header inserts for HTTP statues |
5 | # | 5 | # |
6 | 6 | ||
7 | # Copyright (c) 2019 Karlson2k (Evgeny Grin) <k2k@yandex.ru> | 7 | # Copyright (c) 2019-2021 Karlson2k (Evgeny Grin) <k2k@yandex.ru> |
8 | # | 8 | # |
9 | # Copying and distribution of this file, with or without modification, are | 9 | # Copying and distribution of this file, with or without modification, are |
10 | # permitted in any medium without royalty provided the copyright notice | 10 | # permitted in any medium without royalty provided the copyright notice |
@@ -13,25 +13,25 @@ | |||
13 | 13 | ||
14 | wget -nv https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv -O http-status-codes-1.csv || exit | 14 | wget -nv https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv -O http-status-codes-1.csv || exit |
15 | echo Generating... | 15 | echo Generating... |
16 | echo "/** | 16 | echo '/** |
17 | * @defgroup httpcode HTTP response codes. | 17 | * @defgroup httpcode HTTP response codes. |
18 | * These are the status codes defined for HTTP responses. | 18 | * These are the status codes defined for HTTP responses. |
19 | * See: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml | 19 | * See: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
20 | * Registry export date: $(date -u +%Y-%m-%d) | 20 | * Registry export date: '"$(date -u +%Y-%m-%d)"' |
21 | * @{ | 21 | * @{ |
22 | */ | 22 | */ |
23 | " > header_insert_statuses.h && \ | 23 | ' > header_insert_statuses.h && \ |
24 | gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"} | 24 | gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"} |
25 | FNR > 1 { | 25 | FNR > 1 { |
26 | gsub(/^\[|^"\[|\]"$|\]$/, "", $3) | 26 | gsub(/^\[|^"\[|\]"$|\]$/, "", $3) |
27 | gsub(/\]\[/, "; ", $3) | 27 | gsub(/\]\[/, "; ", $3) |
28 | if ($1 == 306) { | 28 | if ($1 == 306) { |
29 | $2 = "Switch Proxy" | 29 | $2 = "Switch Proxy" |
30 | $3 = "Not used! " $3 | 30 | $3 = "Not used! " $3 |
31 | } | 31 | } |
32 | if ($2 != "Unassigned") { | 32 | if ($2 != "Unassigned" && $2 != "(Unused)") { |
33 | print "/* " $1 sprintf("%-24s", " \"" $2 "\". ") $3 ". */" | 33 | printf ("/* %s %-22s %s. */\n", $1, "\"" $2 "\".", $3) |
34 | print "#define MHD_HTTP_" toupper(gensub(/[^A-Za-z0-0]/, "_", "g", $2)) " "$1"" | 34 | printf ("#define MHD_HTTP_%-27s %s\n", toupper(gensub(/[^A-Za-z0-0]/, "_", "g", $2)), $1) |
35 | } else { | 35 | } else { |
36 | print "" | 36 | print "" |
37 | } | 37 | } |
@@ -39,13 +39,13 @@ FNR > 1 { | |||
39 | echo ' | 39 | echo ' |
40 | /* Not registered non-standard codes */ | 40 | /* Not registered non-standard codes */ |
41 | /* 449 "Reply With". MS IIS extension. */ | 41 | /* 449 "Reply With". MS IIS extension. */ |
42 | #define MHD_HTTP_RETRY_WITH 449 | 42 | #define MHD_HTTP_RETRY_WITH 449 |
43 | 43 | ||
44 | /* 450 "Blocked by Windows Parental Controls". MS extension. */ | 44 | /* 450 "Blocked by Windows Parental Controls". MS extension. */ |
45 | #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450 | 45 | #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450 |
46 | 46 | ||
47 | /* 509 "Bandwidth Limit Exceeded". Apache extension. */ | 47 | /* 509 "Bandwidth Limit Exceeded". Apache extension. */ |
48 | #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509 | 48 | #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509 |
49 | ' >> header_insert_statuses.h && \ | 49 | ' >> header_insert_statuses.h && \ |
50 | gawk -e 'BEGIN { | 50 | gawk -e 'BEGIN { |
51 | FPAT = "([^,]*)|(\"[^\"]+\")" | 51 | FPAT = "([^,]*)|(\"[^\"]+\")" |
@@ -76,10 +76,10 @@ FNR > 1 { | |||
76 | print "static const struct _MHD_str_w_len " hundreds[$1/100] "_hundred[] = {" | 76 | print "static const struct _MHD_str_w_len " hundreds[$1/100] "_hundred[] = {" |
77 | } | 77 | } |
78 | if (num == 306) { | 78 | if (num == 306) { |
79 | reason = "Switch Proxy" | 79 | reason = "Switch Proxy" |
80 | desc = "Not used! " desc | 80 | desc = "Not used! " desc |
81 | } | 81 | } |
82 | if (reason == "Unassigned") next | 82 | if (reason == "Unassigned" || reason == "(Unused)") next |
83 | if (prev_num != num) | 83 | if (prev_num != num) |
84 | printf (" /* %s */ %-36s /* %s */\n", prev_num, "_MHD_S_STR_W_LEN (\""prev_reason"\"),", prev_desc) | 84 | printf (" /* %s */ %-36s /* %s */\n", prev_num, "_MHD_S_STR_W_LEN (\""prev_reason"\"),", prev_desc) |
85 | while(++prev_num < num) { | 85 | while(++prev_num < num) { |