gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated (c530ee3b -> fb550a49


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (c530ee3b -> fb550a49)
Date: Sun, 09 Jun 2019 11:15:42 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from c530ee3b update .gitignore files
     new 63fdb091 Updated .gitattributes, normalized line ending in source file
     new 56827b9b contrib: published scripts for updating MHD header with new 
HTTP methods and headers
     new d496504d libmicrohttpd.h: Updated HTTP methods and headers
     new b0e92996 microhttpd.h: moved deprecated HTTP code definitions to the 
end of the list
     new badb814e microhttpd.h: moved together deprecated and non-standard HTTP 
status codes, deprecated more HTTP status codes
     new e5f188a4 contrib: implemented script for importing HTTP status codes
     new 6c1d4ad7 Updated HTTP status codes
     new fb550a49 microhttpd.d: fixed Doxy for MHD_get_reason_phrase_for()

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitattributes                       |   1 +
 contrib/gen_http_headers_insert.sh   |  62 +++++++++++
 contrib/gen_http_methods_insert.sh   |  62 +++++++++++
 contrib/gen_http_statuses_inserts.sh |  85 ++++++++++++++
 src/include/microhttpd.h             | 168 +++++++++++++++++++++++-----
 src/microhttpd/reason_phrase.c       | 209 ++++++++++++++++++-----------------
 src/microhttpd/test_daemon.c         |   2 +-
 7 files changed, 455 insertions(+), 134 deletions(-)
 create mode 100755 contrib/gen_http_headers_insert.sh
 create mode 100755 contrib/gen_http_methods_insert.sh
 create mode 100755 contrib/gen_http_statuses_inserts.sh

diff --git a/.gitattributes b/.gitattributes
index cb45bd1f..f152eb27 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,4 +1,5 @@
 *.m4   eol=lf
+*.sh   eol=lf
 configure.ac   eol=lf
 makefile.am    eol=lf
 .gitattributes eol=lf
diff --git a/contrib/gen_http_headers_insert.sh 
b/contrib/gen_http_headers_insert.sh
new file mode 100755
index 00000000..6fce2809
--- /dev/null
+++ b/contrib/gen_http_headers_insert.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+#
+#   Generate header insert for HTTP headers
+#
+
+#   Copyright (c) 2015-2019 Karlson2k (Evgeny Grin) <address@hidden>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+wget -nv http://www.iana.org/assignments/message-headers/perm-headers.csv -O 
perm-headers.csv || exit
+echo Generating...
+echo '/**
+ * @defgroup headers HTTP headers
+ * These are the standard headers found in HTTP requests and responses.
+ * See: http://www.iana.org/assignments/message-headers/message-headers.xml
+ * Registry export date: '$(date -u +%Y-%m-%d)'
+ * @{
+ */
+
+/* Main HTTP headers. */' > header_insert_headers.h && \
+gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"}
+{
+  if ($3 == "http") {
+    gsub(/^\[|^"\[|\]"$|\]$/, "", $5)
+    rfc_num = substr($5, 4, 4)
+    if (rfc_num >= 7230 && rfc_num <= 7235)
+    {
+      gsub(/\]\[/, "; ", $5)
+      if (length($4) == 0) 
+      { $4 = "No category" }
+      else
+      { sub(/^./, toupper(substr($4, 1, 1)), $4) }
+      print "/* " sprintf("%-14.14s", $4 ".") " " $5 " */"
+      print "#define MHD_HTTP_HEADER_" toupper(gensub(/-/, "_", "g", $1)) " 
\""$1"\""
+    }
+  }
+}' perm-headers.csv >> header_insert_headers.h && \
+echo '
+/* Additional HTTP headers. */' >> header_insert_headers.h && \
+gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"}
+{
+  if ($3 == "http") {
+    gsub(/^\[|^"\[|\]"$|\]$/, "", $5)
+    rfc_num = substr($5, 4, 4)
+    if (!(rfc_num >= 7230 && rfc_num <= 7235))
+    {
+      gsub(/\]\[/, "; ", $5)
+      if (length($4) == 0) 
+      { $4 = "No category" }
+      else
+      { sub(/^./, toupper(substr($4, 1, 1)), $4) }
+      print "/* " sprintf("%-14.14s", $4 ".") " " $5 " */"
+      print "#define MHD_HTTP_HEADER_" toupper(gensub(/-/, "_", "g", $1)) " 
\""$1"\""
+    }
+  }
+}' perm-headers.csv >> header_insert_headers.h && \
+echo OK && \
+rm perm-headers.csv || exit
diff --git a/contrib/gen_http_methods_insert.sh 
b/contrib/gen_http_methods_insert.sh
new file mode 100755
index 00000000..38485848
--- /dev/null
+++ b/contrib/gen_http_methods_insert.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+#
+#   Generate header insert for HTTP methods
+#
+
+#   Copyright (c) 2015-2019 Karlson2k (Evgeny Grin) <address@hidden>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+wget -nv http://www.iana.org/assignments/http-methods/methods.csv -O 
methods.csv || exit
+echo Generating...
+echo '/**
+ * @defgroup methods HTTP methods
+ * HTTP methods (as strings).
+ * See: http://www.iana.org/assignments/http-methods/http-methods.xml
+ * Registry export date: '$(date -u +%Y-%m-%d)'
+ * @{
+ */
+
+/* Main HTTP methods. */' > header_insert_methods.h && \
+gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"}
+FNR > 1 {
+  gsub(/^\[|^"\[|\]"$|\]$/, "", $4)
+  gsub(/\]\[/, "; ", $4)
+  if (substr($4, 1, 7) == "RFC7231") {
+    if ($2 == "yes")
+    { safe_m = "Safe.    " }
+    else
+    { safe_m = "Not safe." }
+    if ($3 == "yes")
+    { indem_m = "Idempotent.    " }
+    else
+    { indem_m = "Not idempotent." }
+    print "/* " safe_m " " indem_m " " $4 ". */"
+    print "#define MHD_HTTP_METHOD_" toupper(gensub(/-/, "_", "g", $1)) " 
\""$1"\""
+  }
+}' methods.csv >> header_insert_methods.h && \
+echo '
+/* Additional HTTP methods. */' >> header_insert_methods.h && \
+gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"}
+FNR > 1 {
+  gsub(/^\[|^"\[|\]"$|\]$/, "", $4)
+  gsub(/\]\[/, "; ", $4)
+  if (substr($4, 1, 7) != "RFC7231") {
+    if ($2 == "yes")
+    { safe_m = "Safe.    " }
+    else
+    { safe_m = "Not safe." }
+    if ($3 == "yes")
+    { indem_m = "Idempotent.    " }
+    else
+    { indem_m = "Not idempotent." }
+    print "/* " safe_m " " indem_m " " $4 ". */"
+    print "#define MHD_HTTP_METHOD_" toupper(gensub(/-/, "_", "g", $1)) " 
\""$1"\""
+  }
+}' methods.csv >> header_insert_methods.h && \
+echo OK && \
+rm methods.csv || exit
diff --git a/contrib/gen_http_statuses_inserts.sh 
b/contrib/gen_http_statuses_inserts.sh
new file mode 100755
index 00000000..07c2075f
--- /dev/null
+++ b/contrib/gen_http_statuses_inserts.sh
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+#
+#   Generate code and header inserts for HTTP statues
+#
+
+#   Copyright (c) 2019 Karlson2k (Evgeny Grin) <address@hidden>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+wget -nv 
https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv -O 
http-status-codes-1.csv || exit
+echo Generating...
+echo "/**
+ * @defgroup httpcode HTTP response codes.
+ * These are the status codes defined for HTTP responses.
+ * See: 
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
+ * Registry export date: $(date -u +%Y-%m-%d)
+ * @{
+ */
+" > header_insert_statuses.h && \
+gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"}
+FNR > 1 {
+  gsub(/^\[|^"\[|\]"$|\]$/, "", $3)
+  gsub(/\]\[/, "; ", $3)
+  if ($1 == 306) { 
+    $2 = "Switch Proxy" 
+    $3 = "Not used! " $3
+  }
+  if ($2 != "Unassigned") {
+    print "/* " $1 sprintf("%-24s", " \"" $2 "\". ") $3 ". */"
+    print "#define MHD_HTTP_" toupper(gensub(/[^A-Za-z0-0]/, "_", "g", $2)) " 
"$1""
+  } else {
+    print ""
+  }
+}' http-status-codes-1.csv >> header_insert_statuses.h && \
+echo '
+/* Not registered non-standard codes */
+/* 449 "Reply With".          MS IIS extension. */
+#define MHD_HTTP_RETRY_WITH 449
+
+/* 450 "Blocked by Windows Parental Controls". MS extension. */
+#define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
+
+/* 509 "Bandwidth Limit Exceeded". Apache extension. */
+#define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
+' >> header_insert_statuses.h && \
+gawk -e 'BEGIN {
+  FPAT = "([^,]*)|(\"[^\"]+\")"
+  hundreds[1]="one"
+  hundreds[2]="two"
+  hundreds[3]="three"
+  hundreds[4]="four"
+  hundreds[5]="five"
+  hundreds[6]="six"
+  prev_num=0
+}
+FNR > 1 {
+  gsub(/^\[|^"\[|\]"$|\]$/, "", $3)
+  gsub(/\]\[/, "; ", $3)
+  if ($1 % 100 == 0) {
+    if ($1 != 100) { printf("\n};\n\n") }
+    prev_num=$1 - 1;
+    print "static const char *const " hundreds[$1/100] "_hundred[] = {"
+  }
+  if ($1 == 306) { 
+    $2 = "Switch Proxy" 
+    $3 = "Not used! " $3
+  }
+  if ($2 == "Unassigned") next
+  while(++prev_num != $1) {
+    if (prev_num == 449) {reason="Reply With"; desc="MS IIS extension";}
+    else if (prev_num == 450) {reason="Blocked by Windows Parental Controls"; 
desc="MS extension";}
+    else if (prev_num == 509) {reason="Bandwidth Limit Exceeded"; desc="Apache 
extension";}
+    else {reason="Unknown"; desc="Not used";}
+    printf (",\n  /* %s */ %-24s /* %s */", prev_num, "\"" reason "\"", desc)
+  }
+  if ($1 % 100 != 0) { print "," }
+  printf ("  /* %s */ %-24s /* %s */", $1, "\""$2"\"", $3)
+}
+END {printf("\n};\n")}' http-status-codes-1.csv >> code_insert_statuses.c && \
+echo OK && \
+rm http-status-codes-1.csv || exit
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 117062e8..577ebc59 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -304,104 +304,191 @@ _MHD_DEPR_MACRO("Macro MHD_LONG_LONG_PRINTF is 
deprecated, use MHD_UNSIGNED_LONG
 /**
  * @defgroup httpcode HTTP response codes.
  * These are the status codes defined for HTTP responses.
+ * See: 
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
+ * Registry export date: 2019-06-09
  * @{
  */
-/* See 
http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml */
 
+/* 100 "Continue".            RFC7231, Section 6.2.1. */
 #define MHD_HTTP_CONTINUE 100
+/* 101 "Switching Protocols". RFC7231, Section 6.2.2. */
 #define MHD_HTTP_SWITCHING_PROTOCOLS 101
+/* 102 "Processing".          RFC2518. */
 #define MHD_HTTP_PROCESSING 102
+/* 103 "Early Hints".         RFC8297. */
+#define MHD_HTTP_EARLY_HINTS 103
 
+/* 200 "OK".                  RFC7231, Section 6.3.1. */
 #define MHD_HTTP_OK 200
+/* 201 "Created".             RFC7231, Section 6.3.2. */
 #define MHD_HTTP_CREATED 201
+/* 202 "Accepted".            RFC7231, Section 6.3.3. */
 #define MHD_HTTP_ACCEPTED 202
+/* 203 "Non-Authoritative Information". RFC7231, Section 6.3.4. */
 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
+/* 204 "No Content".          RFC7231, Section 6.3.5. */
 #define MHD_HTTP_NO_CONTENT 204
+/* 205 "Reset Content".       RFC7231, Section 6.3.6. */
 #define MHD_HTTP_RESET_CONTENT 205
+/* 206 "Partial Content".     RFC7233, Section 4.1. */
 #define MHD_HTTP_PARTIAL_CONTENT 206
+/* 207 "Multi-Status".        RFC4918. */
 #define MHD_HTTP_MULTI_STATUS 207
+/* 208 "Already Reported".    RFC5842. */
 #define MHD_HTTP_ALREADY_REPORTED 208
 
+/* 226 "IM Used".             RFC3229. */
 #define MHD_HTTP_IM_USED 226
 
+/* 300 "Multiple Choices".    RFC7231, Section 6.4.1. */
 #define MHD_HTTP_MULTIPLE_CHOICES 300
+/* 301 "Moved Permanently".   RFC7231, Section 6.4.2. */
 #define MHD_HTTP_MOVED_PERMANENTLY 301
+/* 302 "Found".               RFC7231, Section 6.4.3. */
 #define MHD_HTTP_FOUND 302
+/* 303 "See Other".           RFC7231, Section 6.4.4. */
 #define MHD_HTTP_SEE_OTHER 303
+/* 304 "Not Modified".        RFC7232, Section 4.1. */
 #define MHD_HTTP_NOT_MODIFIED 304
+/* 305 "Use Proxy".           RFC7231, Section 6.4.5. */
 #define MHD_HTTP_USE_PROXY 305
+/* 306 "Switch Proxy".        Not used! RFC7231, Section 6.4.6. */
 #define MHD_HTTP_SWITCH_PROXY 306
+/* 307 "Temporary Redirect".  RFC7231, Section 6.4.7. */
 #define MHD_HTTP_TEMPORARY_REDIRECT 307
+/* 308 "Permanent Redirect".  RFC7538. */
 #define MHD_HTTP_PERMANENT_REDIRECT 308
 
+/* 400 "Bad Request".         RFC7231, Section 6.5.1. */
 #define MHD_HTTP_BAD_REQUEST 400
+/* 401 "Unauthorized".        RFC7235, Section 3.1. */
 #define MHD_HTTP_UNAUTHORIZED 401
+/* 402 "Payment Required".    RFC7231, Section 6.5.2. */
 #define MHD_HTTP_PAYMENT_REQUIRED 402
+/* 403 "Forbidden".           RFC7231, Section 6.5.3. */
 #define MHD_HTTP_FORBIDDEN 403
+/* 404 "Not Found".           RFC7231, Section 6.5.4. */
 #define MHD_HTTP_NOT_FOUND 404
+/* 405 "Method Not Allowed".  RFC7231, Section 6.5.5. */
 #define MHD_HTTP_METHOD_NOT_ALLOWED 405
+/* 406 "Not Acceptable".      RFC7231, Section 6.5.6. */
 #define MHD_HTTP_NOT_ACCEPTABLE 406
-/** @deprecated */
-#define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use 
MHD_HTTP_NOT_ACCEPTABLE") 406
+/* 407 "Proxy Authentication Required". RFC7235, Section 3.2. */
 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
+/* 408 "Request Timeout".     RFC7231, Section 6.5.7. */
 #define MHD_HTTP_REQUEST_TIMEOUT 408
+/* 409 "Conflict".            RFC7231, Section 6.5.8. */
 #define MHD_HTTP_CONFLICT 409
+/* 410 "Gone".                RFC7231, Section 6.5.9. */
 #define MHD_HTTP_GONE 410
+/* 411 "Length Required".     RFC7231, Section 6.5.10. */
 #define MHD_HTTP_LENGTH_REQUIRED 411
+/* 412 "Precondition Failed". RFC7232, Section 4.2; RFC8144, Section 3.2. */
 #define MHD_HTTP_PRECONDITION_FAILED 412
+/* 413 "Payload Too Large".   RFC7231, Section 6.5.11. */
 #define MHD_HTTP_PAYLOAD_TOO_LARGE 413
-/** @deprecated */
-#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, 
use MHD_HTTP_PAYLOAD_TOO_LARGE") 413
+/* 414 "URI Too Long".        RFC7231, Section 6.5.12. */
 #define MHD_HTTP_URI_TOO_LONG 414
-/** @deprecated */
-#define MHD_HTTP_REQUEST_URI_TOO_LONG \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use 
MHD_HTTP_URI_TOO_LONG") 414
+/* 415 "Unsupported Media Type". RFC7231, Section 6.5.13; RFC7694, Section 3. 
*/
 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
+/* 416 "Range Not Satisfiable". RFC7233, Section 4.4. */
 #define MHD_HTTP_RANGE_NOT_SATISFIABLE 416
-/** @deprecated */
-#define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
-  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is 
deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") 416
+/* 417 "Expectation Failed".  RFC7231, Section 6.5.14. */
 #define MHD_HTTP_EXPECTATION_FAILED 417
 
+/* 421 "Misdirected Request". RFC7540, Section 9.1.2. */
 #define MHD_HTTP_MISDIRECTED_REQUEST 421
+/* 422 "Unprocessable Entity". RFC4918. */
 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422
+/* 423 "Locked".              RFC4918. */
 #define MHD_HTTP_LOCKED 423
+/* 424 "Failed Dependency".   RFC4918. */
 #define MHD_HTTP_FAILED_DEPENDENCY 424
-#define MHD_HTTP_UNORDERED_COLLECTION 425
+/* 425 "Too Early".           RFC8470. */
+#define MHD_HTTP_TOO_EARLY 425
+/* 426 "Upgrade Required".    RFC7231, Section 6.5.15. */
 #define MHD_HTTP_UPGRADE_REQUIRED 426
 
+/* 428 "Precondition Required". RFC6585. */
 #define MHD_HTTP_PRECONDITION_REQUIRED 428
+/* 429 "Too Many Requests".   RFC6585. */
 #define MHD_HTTP_TOO_MANY_REQUESTS 429
-#define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
 
-#define MHD_HTTP_NO_RESPONSE 444
+/* 431 "Request Header Fields Too Large". RFC6585. */
+#define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
 
-#define MHD_HTTP_RETRY_WITH 449
-#define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
+/* 451 "Unavailable For Legal Reasons". RFC7725. */
 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
 
+/* 500 "Internal Server Error". RFC7231, Section 6.6.1. */
 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
+/* 501 "Not Implemented".     RFC7231, Section 6.6.2. */
 #define MHD_HTTP_NOT_IMPLEMENTED 501
+/* 502 "Bad Gateway".         RFC7231, Section 6.6.3. */
 #define MHD_HTTP_BAD_GATEWAY 502
+/* 503 "Service Unavailable". RFC7231, Section 6.6.4. */
 #define MHD_HTTP_SERVICE_UNAVAILABLE 503
+/* 504 "Gateway Timeout".     RFC7231, Section 6.6.5. */
 #define MHD_HTTP_GATEWAY_TIMEOUT 504
+/* 505 "HTTP Version Not Supported". RFC7231, Section 6.6.6. */
 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
+/* 506 "Variant Also Negotiates". RFC2295. */
 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
+/* 507 "Insufficient Storage". RFC4918. */
 #define MHD_HTTP_INSUFFICIENT_STORAGE 507
+/* 508 "Loop Detected".       RFC5842. */
 #define MHD_HTTP_LOOP_DETECTED 508
-#define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
+
+/* 510 "Not Extended".        RFC2774. */
 #define MHD_HTTP_NOT_EXTENDED 510
+/* 511 "Network Authentication Required". RFC6585. */
 #define MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511
 
+
+/* Not registered non-standard codes */
+/* 449 "Reply With".          MS IIS extension. */
+#define MHD_HTTP_RETRY_WITH 449
+
+/* 450 "Blocked by Windows Parental Controls". MS extension. */
+#define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
+
+/* 509 "Bandwidth Limit Exceeded". Apache extension. */
+#define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
+
+
+/* Deprecated codes */
+/** @deprecated */
+#define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
+  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use 
MHD_HTTP_NOT_ACCEPTABLE") 406
+
+/** @deprecated */
+#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
+  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, 
use MHD_HTTP_PAYLOAD_TOO_LARGE") 413
+
+/** @deprecated */
+#define MHD_HTTP_REQUEST_URI_TOO_LONG \
+  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use 
MHD_HTTP_URI_TOO_LONG") 414
+
+/** @deprecated */
+#define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
+  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is 
deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") 416
+
+/** @deprecated */
+#define MHD_HTTP_UNORDERED_COLLECTION \
+  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it 
was removed from RFC") 425
+
+/** @deprecated */
+#define MHD_HTTP_NO_RESPONSE \
+  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx 
internal code for logs only") 444
+
+
 /** @} */ /* end of group httpcode */
 
 /**
  * Returns the string reason phrase for a response code.
  *
- * If we don't have a string for a status code, we give the first
- * message in that status code class.
+ * If message string is not available for a status code,
+ * "Unknown" string will be returned.
  */
 _MHD_EXTERN const char *
 MHD_get_reason_phrase_for (unsigned int code);
@@ -419,7 +506,7 @@ MHD_get_reason_phrase_for (unsigned int code);
  * @defgroup headers HTTP headers
  * These are the standard headers found in HTTP requests and responses.
  * See: http://www.iana.org/assignments/message-headers/message-headers.xml
- * Registry Version 2017-01-27
+ * Registry export date: 2019-06-09
  * @{
  */
 
@@ -532,6 +619,8 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_ACCEPT_FEATURES "Accept-Features"
 /* No category.   RFC5789 */
 #define MHD_HTTP_HEADER_ACCEPT_PATCH "Accept-Patch"
+/* Standard.      https://www.w3.org/TR/ldp/ */
+#define MHD_HTTP_HEADER_ACCEPT_POST "Accept-Post"
 /* Standard.      RFC7639, Section 2 */
 #define MHD_HTTP_HEADER_ALPN "ALPN"
 /* Standard.      RFC7838 */
@@ -556,8 +645,12 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_C_PEP "C-PEP"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_C_PEP_INFO "C-PEP-Info"
+/* Standard.      RFC8607, Section 5.1 */
+#define MHD_HTTP_HEADER_CAL_MANAGED_ID "Cal-Managed-ID"
 /* Standard.      RFC7809, Section 7.1 */
 #define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones"
+/* Standard.      RFC8586 */
+#define MHD_HTTP_HEADER_CDN_LOOP "CDN-Loop"
 /* Obsoleted.     RFC2068; RFC2616 */
 #define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base"
 /* Standard.      RFC6266 */
@@ -594,6 +687,10 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_DIFFERENTIAL_ID "Differential-ID"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_DIGEST "Digest"
+/* Standard.      RFC8470 */
+#define MHD_HTTP_HEADER_EARLY_DATA "Early-Data"
+/* Experimental.  RFC-ietf-httpbis-expect-ct-08 */
+#define MHD_HTTP_HEADER_EXPECT_CT "Expect-CT"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_EXT "Ext"
 /* Standard.      RFC7239 */
@@ -610,11 +707,13 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_IF "If"
 /* Standard.      RFC6638 */
 #define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match"
+/* Standard.      RFC8473 */
+#define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID 
"Include-Referred-Token-Binding-ID"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_LABEL "Label"
-/* No category.   RFC5988 */
+/* Standard.      RFC8288 */
 #define MHD_HTTP_HEADER_LINK "Link"
 /* Standard.      RFC4918 */
 #define MHD_HTTP_HEADER_LOCK_TOKEN "Lock-Token"
@@ -634,6 +733,8 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type"
 /* Standard.      RFC6454 */
 #define MHD_HTTP_HEADER_ORIGIN "Origin"
+/* Standard.      RFC-ietf-core-object-security-16, Section 11.1 */
+#define MHD_HTTP_HEADER_OSCORE "OSCORE"
 /* Standard.      RFC4918 */
 #define MHD_HTTP_HEADER_OVERWRITE "Overwrite"
 /* No category.   RFC4229 */
@@ -674,12 +775,16 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY 
"Public-Key-Pins-Report-Only"
 /* No category.   RFC4437 */
 #define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
+/* Standard.      RFC8555, Section 6.5.1 */
+#define MHD_HTTP_HEADER_REPLAY_NONCE "Replay-Nonce"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_SAFE "Safe"
 /* Standard.      RFC6638 */
 #define MHD_HTTP_HEADER_SCHEDULE_REPLY "Schedule-Reply"
 /* Standard.      RFC6638 */
 #define MHD_HTTP_HEADER_SCHEDULE_TAG "Schedule-Tag"
+/* Standard.      RFC8473 */
+#define MHD_HTTP_HEADER_SEC_TOKEN_BINDING "Sec-Token-Binding"
 /* Standard.      RFC6455 */
 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT "Sec-WebSocket-Accept"
 /* Standard.      RFC6455 */
@@ -706,6 +811,8 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_STATUS_URI "Status-URI"
 /* Standard.      RFC6797 */
 #define MHD_HTTP_HEADER_STRICT_TRANSPORT_SECURITY "Strict-Transport-Security"
+/* Informational. RFC8594 */
+#define MHD_HTTP_HEADER_SUNSET "Sunset"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_SURROGATE_CAPABILITY "Surrogate-Capability"
 /* No category.   RFC4229 */
@@ -726,6 +833,8 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_HEADER_VARIANT_VARY "Variant-Vary"
 /* No category.   RFC4229 */
 #define MHD_HTTP_HEADER_WANT_DIGEST "Want-Digest"
+/* Standard.      https://fetch.spec.whatwg.org/#x-content-type-options-header 
*/
+#define MHD_HTTP_HEADER_X_CONTENT_TYPE_OPTIONS "X-Content-Type-Options"
 /* Informational. RFC7034 */
 #define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
 
@@ -748,9 +857,10 @@ MHD_get_reason_phrase_for (unsigned int code);
  * @defgroup methods HTTP methods
  * HTTP methods (as strings).
  * See: http://www.iana.org/assignments/http-methods/http-methods.xml
- * Registry Version 2015-05-19
+ * Registry export date: 2019-06-09
  * @{
  */
+
 /* Main HTTP methods. */
 /* Not safe. Not idempotent. RFC7231, Section 4.3.6. */
 #define MHD_HTTP_METHOD_CONNECT "CONNECT"
@@ -792,9 +902,9 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_METHOD_MERGE "MERGE"
 /* Not safe. Idempotent.     RFC3253, Section 13.5. */
 #define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY"
-/* Not safe. Idempotent.     RFC4791, Section 5.3.1. */
+/* Not safe. Idempotent.     RFC4791, Section 5.3.1; RFC8144, Section 2.3. */
 #define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR"
-/* Not safe. Idempotent.     RFC4918, Section 9.3. */
+/* Not safe. Idempotent.     RFC4918, Section 9.3; RFC5689, Section 3; 
RFC8144, Section 2.3. */
 #define MHD_HTTP_METHOD_MKCOL "MKCOL"
 /* Not safe. Idempotent.     RFC4437, Section 6. */
 #define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF"
@@ -808,13 +918,13 @@ MHD_get_reason_phrase_for (unsigned int code);
 #define MHD_HTTP_METHOD_PATCH "PATCH"
 /* Safe.     Idempotent.     RFC7540, Section 3.5. */
 #define MHD_HTTP_METHOD_PRI "PRI"
-/* Safe.     Idempotent.     RFC4918, Section 9.1. */
+/* Safe.     Idempotent.     RFC4918, Section 9.1; RFC8144, Section 2.1. */
 #define MHD_HTTP_METHOD_PROPFIND "PROPFIND"
-/* Not safe. Idempotent.     RFC4918, Section 9.2. */
+/* Not safe. Idempotent.     RFC4918, Section 9.2; RFC8144, Section 2.2. */
 #define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH"
 /* Not safe. Idempotent.     RFC5842, Section 6. */
 #define MHD_HTTP_METHOD_REBIND "REBIND"
-/* Safe.     Idempotent.     RFC3253, Section 3.6. */
+/* Safe.     Idempotent.     RFC3253, Section 3.6; RFC8144, Section 2.1. */
 #define MHD_HTTP_METHOD_REPORT "REPORT"
 /* Safe.     Idempotent.     RFC5323, Section 2. */
 #define MHD_HTTP_METHOD_SEARCH "SEARCH"
diff --git a/src/microhttpd/reason_phrase.c b/src/microhttpd/reason_phrase.c
index a6ffc75f..d6fe8330 100644
--- a/src/microhttpd/reason_phrase.c
+++ b/src/microhttpd/reason_phrase.c
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     Copyright (C) 2007, 2011, 2017 Christian Grothoff, Karlson2k (Evgeny Grin)
+     Copyright (C) 2007, 2011, 2017, 2019 Christian Grothoff, Karlson2k 
(Evgeny Grin)
 
      This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
@@ -36,121 +36,122 @@ static const char *const invalid_hundred[] = {
 };
 
 static const char *const one_hundred[] = {
-  "Continue",
-  "Switching Protocols",
-  "Processing"
+  /* 100 */ "Continue"               /* RFC7231, Section 6.2.1 */,
+  /* 101 */ "Switching Protocols"    /* RFC7231, Section 6.2.2 */,
+  /* 102 */ "Processing"             /* RFC2518 */,
+  /* 103 */ "Early Hints"            /* RFC8297 */
 };
 
 static const char *const two_hundred[] = {
-  "OK",
-  "Created",
-  "Accepted",
-  "Non-Authoritative Information",
-  "No Content",
-  "Reset Content",
-  "Partial Content",
-  "Multi-Status",
-  "Already Reported",
-  "Unknown",
-  "Unknown", /* 210 */
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown", /* 215 */
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown", /* 220 */
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown", /* 225 */
-  "IM Used"
+  /* 200 */ "OK"                     /* RFC7231, Section 6.3.1 */,
+  /* 201 */ "Created"                /* RFC7231, Section 6.3.2 */,
+  /* 202 */ "Accepted"               /* RFC7231, Section 6.3.3 */,
+  /* 203 */ "Non-Authoritative Information" /* RFC7231, Section 6.3.4 */,
+  /* 204 */ "No Content"             /* RFC7231, Section 6.3.5 */,
+  /* 205 */ "Reset Content"          /* RFC7231, Section 6.3.6 */,
+  /* 206 */ "Partial Content"        /* RFC7233, Section 4.1 */,
+  /* 207 */ "Multi-Status"           /* RFC4918 */,
+  /* 208 */ "Already Reported"       /* RFC5842 */,
+  /* 209 */ "Unknown"                /* Not used */,
+  /* 210 */ "Unknown"                /* Not used */,
+  /* 211 */ "Unknown"                /* Not used */,
+  /* 212 */ "Unknown"                /* Not used */,
+  /* 213 */ "Unknown"                /* Not used */,
+  /* 214 */ "Unknown"                /* Not used */,
+  /* 215 */ "Unknown"                /* Not used */,
+  /* 216 */ "Unknown"                /* Not used */,
+  /* 217 */ "Unknown"                /* Not used */,
+  /* 218 */ "Unknown"                /* Not used */,
+  /* 219 */ "Unknown"                /* Not used */,
+  /* 220 */ "Unknown"                /* Not used */,
+  /* 221 */ "Unknown"                /* Not used */,
+  /* 222 */ "Unknown"                /* Not used */,
+  /* 223 */ "Unknown"                /* Not used */,
+  /* 224 */ "Unknown"                /* Not used */,
+  /* 225 */ "Unknown"                /* Not used */,
+  /* 226 */ "IM Used"                /* RFC3229 */
 };
 
 static const char *const three_hundred[] = {
-  "Multiple Choices",
-  "Moved Permanently",
-  "Found",
-  "See Other",
-  "Not Modified",
-  "Use Proxy",
-  "Switch Proxy",
-  "Temporary Redirect",
-  "Permanent Redirect"
+  /* 300 */ "Multiple Choices"       /* RFC7231, Section 6.4.1 */,
+  /* 301 */ "Moved Permanently"      /* RFC7231, Section 6.4.2 */,
+  /* 302 */ "Found"                  /* RFC7231, Section 6.4.3 */,
+  /* 303 */ "See Other"              /* RFC7231, Section 6.4.4 */,
+  /* 304 */ "Not Modified"           /* RFC7232, Section 4.1 */,
+  /* 305 */ "Use Proxy"              /* RFC7231, Section 6.4.5 */,
+  /* 306 */ "Switch Proxy"           /* Not used! RFC7231, Section 6.4.6 */,
+  /* 307 */ "Temporary Redirect"     /* RFC7231, Section 6.4.7 */,
+  /* 308 */ "Permanent Redirect"     /* RFC7538 */
 };
 
 static const char *const four_hundred[] = {
-  "Bad Request",
-  "Unauthorized",
-  "Payment Required",
-  "Forbidden",
-  "Not Found",
-  "Method Not Allowed",
-  "Not Acceptable",
-  "Proxy Authentication Required",
-  "Request Timeout",
-  "Conflict",
-  "Gone",
-  "Length Required",
-  "Precondition Failed",
-  "Payload Too Large",
-  "URI Too Long",
-  "Unsupported Media Type",
-  "Range Not Satisfiable",
-  "Expectation Failed",
-  "Unknown",
-  "Unknown",
-  "Unknown", /* 420 */
-  "Misdirected Request",
-  "Unprocessable Entity",
-  "Locked",
-  "Failed Dependency",
-  "Unordered Collection",
-  "Upgrade Required",
-  "Unknown",
-  "Precondition Required",
-  "Too Many Requests",
-  "Unknown", /* 430 */
-  "Request Header Fields Too Large",
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown", /* 435 */
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Unknown", /* 440 */
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "No Response",
-  "Unknown", /* 445 */
-  "Unknown",
-  "Unknown",
-  "Unknown",
-  "Retry With",
-  "Blocked by Windows Parental Controls", /* 450 */
-  "Unavailable For Legal Reasons"
+  /* 400 */ "Bad Request"            /* RFC7231, Section 6.5.1 */,
+  /* 401 */ "Unauthorized"           /* RFC7235, Section 3.1 */,
+  /* 402 */ "Payment Required"       /* RFC7231, Section 6.5.2 */,
+  /* 403 */ "Forbidden"              /* RFC7231, Section 6.5.3 */,
+  /* 404 */ "Not Found"              /* RFC7231, Section 6.5.4 */,
+  /* 405 */ "Method Not Allowed"     /* RFC7231, Section 6.5.5 */,
+  /* 406 */ "Not Acceptable"         /* RFC7231, Section 6.5.6 */,
+  /* 407 */ "Proxy Authentication Required" /* RFC7235, Section 3.2 */,
+  /* 408 */ "Request Timeout"        /* RFC7231, Section 6.5.7 */,
+  /* 409 */ "Conflict"               /* RFC7231, Section 6.5.8 */,
+  /* 410 */ "Gone"                   /* RFC7231, Section 6.5.9 */,
+  /* 411 */ "Length Required"        /* RFC7231, Section 6.5.10 */,
+  /* 412 */ "Precondition Failed"    /* RFC7232, Section 4.2; RFC8144, Section 
3.2 */,
+  /* 413 */ "Payload Too Large"      /* RFC7231, Section 6.5.11 */,
+  /* 414 */ "URI Too Long"           /* RFC7231, Section 6.5.12 */,
+  /* 415 */ "Unsupported Media Type" /* RFC7231, Section 6.5.13; RFC7694, 
Section 3 */,
+  /* 416 */ "Range Not Satisfiable"  /* RFC7233, Section 4.4 */,
+  /* 417 */ "Expectation Failed"     /* RFC7231, Section 6.5.14 */,
+  /* 418 */ "Unknown"                /* Not used */,
+  /* 419 */ "Unknown"                /* Not used */,
+  /* 420 */ "Unknown"                /* Not used */,
+  /* 421 */ "Misdirected Request"    /* RFC7540, Section 9.1.2 */,
+  /* 422 */ "Unprocessable Entity"   /* RFC4918 */,
+  /* 423 */ "Locked"                 /* RFC4918 */,
+  /* 424 */ "Failed Dependency"      /* RFC4918 */,
+  /* 425 */ "Too Early"              /* RFC8470 */,
+  /* 426 */ "Upgrade Required"       /* RFC7231, Section 6.5.15 */,
+  /* 427 */ "Unknown"                /* Not used */,
+  /* 428 */ "Precondition Required"  /* RFC6585 */,
+  /* 429 */ "Too Many Requests"      /* RFC6585 */,
+  /* 430 */ "Unknown"                /* Not used */,
+  /* 431 */ "Request Header Fields Too Large" /* RFC6585 */,
+  /* 432 */ "Unknown"                /* Not used */,
+  /* 433 */ "Unknown"                /* Not used */,
+  /* 434 */ "Unknown"                /* Not used */,
+  /* 435 */ "Unknown"                /* Not used */,
+  /* 436 */ "Unknown"                /* Not used */,
+  /* 437 */ "Unknown"                /* Not used */,
+  /* 438 */ "Unknown"                /* Not used */,
+  /* 439 */ "Unknown"                /* Not used */,
+  /* 440 */ "Unknown"                /* Not used */,
+  /* 441 */ "Unknown"                /* Not used */,
+  /* 442 */ "Unknown"                /* Not used */,
+  /* 443 */ "Unknown"                /* Not used */,
+  /* 444 */ "Unknown"                /* Not used */,
+  /* 445 */ "Unknown"                /* Not used */,
+  /* 446 */ "Unknown"                /* Not used */,
+  /* 447 */ "Unknown"                /* Not used */,
+  /* 448 */ "Unknown"                /* Not used */,
+  /* 449 */ "Reply With"             /* MS IIS extension */,
+  /* 450 */ "Blocked by Windows Parental Controls" /* MS extension */,
+  /* 451 */ "Unavailable For Legal Reasons" /* RFC7725 */
 };
 
 static const char *const five_hundred[] = {
-  "Internal Server Error",
-  "Not Implemented",
-  "Bad Gateway",
-  "Service Unavailable",
-  "Gateway Timeout",
-  "HTTP Version Not Supported",
-  "Variant Also Negotiates",
-  "Insufficient Storage",
-  "Loop Detected",
-  "Bandwidth Limit Exceeded",
-  "Not Extended",
-  "Network Authentication Required"
+  /* 500 */ "Internal Server Error"  /* RFC7231, Section 6.6.1 */,
+  /* 501 */ "Not Implemented"        /* RFC7231, Section 6.6.2 */,
+  /* 502 */ "Bad Gateway"            /* RFC7231, Section 6.6.3 */,
+  /* 503 */ "Service Unavailable"    /* RFC7231, Section 6.6.4 */,
+  /* 504 */ "Gateway Timeout"        /* RFC7231, Section 6.6.5 */,
+  /* 505 */ "HTTP Version Not Supported" /* RFC7231, Section 6.6.6 */,
+  /* 506 */ "Variant Also Negotiates" /* RFC2295 */,
+  /* 507 */ "Insufficient Storage"   /* RFC4918 */,
+  /* 508 */ "Loop Detected"          /* RFC5842 */,
+  /* 509 */ "Bandwidth Limit Exceeded" /* Apache extension */,
+  /* 510 */ "Not Extended"           /* RFC2774 */,
+  /* 511 */ "Network Authentication Required" /* RFC6585 */
 };
 
 
diff --git a/src/microhttpd/test_daemon.c b/src/microhttpd/test_daemon.c
index e3b72bcd..af59b86d 100644
--- a/src/microhttpd/test_daemon.c
+++ b/src/microhttpd/test_daemon.c
@@ -43,7 +43,7 @@ testStartError ()
   d = MHD_start_daemon (MHD_USE_ERROR_LOG, 0, NULL, NULL, NULL, NULL);
   if (NULL != d)
   {
-    MHD_stop_daemon (d);
+    MHD_stop_daemon (d);
     fprintf (stderr,
              "Succeeded to start without MHD_AccessHandlerCallback?\n");
     return 1;

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]