diff -Nru libmicrohttpd-0.9.67/ChangeLog libmicrohttpd-0.9.68/ChangeLog --- libmicrohttpd-0.9.67/ChangeLog 2019-10-17 14:59:48.000000000 +0000 +++ libmicrohttpd-0.9.68/ChangeLog 2019-10-26 17:30:14.000000000 +0000 @@ -1,3 +1,11 @@ +Sat 26 Oct 2019 06:53:05 PM CEST + Fix regression where MHD would fail to return an empty response + when used with HTTPS. + Releasing libmicrohttpd 0.9.68. -CG/TR + +Fri 25 Oct 2019 02:31:59 PM CEST + Introduce MHD_RF_INSANITY_HEADER_CONTENT_LENGTH. -CG + Thu 17 Oct 2019 04:50:52 PM CEST Integrate 0-byte send() method for uncorking for old FreeBSD/OS X systems into new mhd_send.c logic for uncorking. diff -Nru libmicrohttpd-0.9.67/configure libmicrohttpd-0.9.68/configure --- libmicrohttpd-0.9.67/configure 2019-10-17 15:01:02.000000000 +0000 +++ libmicrohttpd-0.9.68/configure 2019-10-26 17:30:33.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU Libmicrohttpd 0.9.67. +# Generated by GNU Autoconf 2.69 for GNU Libmicrohttpd 0.9.68. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='GNU Libmicrohttpd' PACKAGE_TARNAME='libmicrohttpd' -PACKAGE_VERSION='0.9.67' -PACKAGE_STRING='GNU Libmicrohttpd 0.9.67' +PACKAGE_VERSION='0.9.68' +PACKAGE_STRING='GNU Libmicrohttpd 0.9.68' PACKAGE_BUGREPORT='libmicrohttpd@gnu.org' PACKAGE_URL='http://www.gnu.org/software/libmicrohttpd/' @@ -1495,7 +1495,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Libmicrohttpd 0.9.67 to adapt to many kinds of systems. +\`configure' configures GNU Libmicrohttpd 0.9.68 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1566,7 +1566,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Libmicrohttpd 0.9.67:";; + short | recursive ) echo "Configuration of GNU Libmicrohttpd 0.9.68:";; esac cat <<\_ACEOF @@ -1728,7 +1728,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU Libmicrohttpd configure 0.9.67 +GNU Libmicrohttpd configure 0.9.68 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2254,7 +2254,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Libmicrohttpd $as_me 0.9.67, which was +It was created by GNU Libmicrohttpd $as_me 0.9.68, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3178,7 +3178,7 @@ # Define the identity of the package. PACKAGE='libmicrohttpd' - VERSION='0.9.67' + VERSION='0.9.68' cat >>confdefs.h <<_ACEOF @@ -3275,9 +3275,9 @@ -LIB_VERSION_CURRENT=66 +LIB_VERSION_CURRENT=67 LIB_VERSION_REVISION=0 -LIB_VERSION_AGE=54 +LIB_VERSION_AGE=55 @@ -18512,7 +18512,7 @@ PACKAGE_VERSION_MAJOR='0' PACKAGE_VERSION_MINOR='9' -PACKAGE_VERSION_SUBMINOR='67' +PACKAGE_VERSION_SUBMINOR='68' as_fn_arith $LIB_VERSION_CURRENT - $LIB_VERSION_AGE && MHD_W32_DLL_SUFF=$as_val @@ -26695,7 +26695,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU Libmicrohttpd $as_me 0.9.67, which was +This file was extended by GNU Libmicrohttpd $as_me 0.9.68, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26763,7 +26763,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU Libmicrohttpd config.status 0.9.67 +GNU Libmicrohttpd config.status 0.9.68 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru libmicrohttpd-0.9.67/configure.ac libmicrohttpd-0.9.68/configure.ac --- libmicrohttpd-0.9.67/configure.ac 2019-10-17 15:00:19.000000000 +0000 +++ libmicrohttpd-0.9.68/configure.ac 2019-10-26 17:29:53.000000000 +0000 @@ -22,15 +22,15 @@ # AC_PREREQ([2.64]) LT_PREREQ([2.4.0]) -AC_INIT([GNU Libmicrohttpd],[0.9.67],[libmicrohttpd@gnu.org]) +AC_INIT([GNU Libmicrohttpd],[0.9.68],[libmicrohttpd@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([silent-rules] [subdir-objects]) AC_CONFIG_HEADERS([MHD_config.h]) AC_CONFIG_MACRO_DIR([m4]) -LIB_VERSION_CURRENT=66 +LIB_VERSION_CURRENT=67 LIB_VERSION_REVISION=0 -LIB_VERSION_AGE=54 +LIB_VERSION_AGE=55 AC_SUBST(LIB_VERSION_CURRENT) AC_SUBST(LIB_VERSION_REVISION) AC_SUBST(LIB_VERSION_AGE) diff -Nru libmicrohttpd-0.9.67/debian/changelog libmicrohttpd-0.9.68/debian/changelog --- libmicrohttpd-0.9.67/debian/changelog 2019-10-20 08:43:00.000000000 +0000 +++ libmicrohttpd-0.9.68/debian/changelog 2019-10-27 18:37:00.000000000 +0000 @@ -1,4 +1,10 @@ -libmicrohttpd (0.9.67-0gnu0~20.04) focal; urgency=medium +libmicrohttpd (0.9.68-0gnu0~20.04) focal; urgency=medium + + * New upstream version 0.9.68. + + -- DNS Sun, 27 Oct 2019 20:37:00 +0200 + +libmicrohttpd (0.9.67-0gnu0) unstable; urgency=medium * New upstream version 0.9.67. diff -Nru libmicrohttpd-0.9.67/doc/doxygen/libmicrohttpd.doxy libmicrohttpd-0.9.68/doc/doxygen/libmicrohttpd.doxy --- libmicrohttpd-0.9.67/doc/doxygen/libmicrohttpd.doxy 2019-10-17 15:01:43.000000000 +0000 +++ libmicrohttpd-0.9.68/doc/doxygen/libmicrohttpd.doxy 2019-10-26 17:30:52.000000000 +0000 @@ -38,7 +38,7 @@ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.9.67 +PROJECT_NUMBER = 0.9.68 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff -Nru libmicrohttpd-0.9.67/doc/libmicrohttpd.info libmicrohttpd-0.9.68/doc/libmicrohttpd.info --- libmicrohttpd-0.9.67/doc/libmicrohttpd.info 2019-10-17 15:01:51.000000000 +0000 +++ libmicrohttpd-0.9.68/doc/libmicrohttpd.info 2019-10-26 17:30:54.000000000 +0000 @@ -1,8 +1,8 @@ -This is libmicrohttpd.info, produced by makeinfo version 6.5 from +This is libmicrohttpd.info, produced by makeinfo version 6.7 from libmicrohttpd.texi. -This manual is for GNU libmicrohttpd (version 0.9.67, 15 September -2019), a library for embedding an HTTP(S) server into C applications. +This manual is for GNU libmicrohttpd (version 0.9.68, 25 October 2019), +a library for embedding an HTTP(S) server into C applications. Copyright © 2007–2019 Christian Grothoff @@ -23,8 +23,8 @@ The GNU libmicrohttpd Library ***************************** -This manual is for GNU libmicrohttpd (version 0.9.67, 15 September -2019), a library for embedding an HTTP(S) server into C applications. +This manual is for GNU libmicrohttpd (version 0.9.68, 25 October 2019), +a library for embedding an HTTP(S) server into C applications. Copyright © 2007–2019 Christian Grothoff @@ -700,6 +700,17 @@ It is not recommended to set it to -1 on publicly available servers as it may potentially lower level of protection. + ‘MHD_OPTION_SERVER_INSANITY’ + Allows the application to disable certain sanity precautions + in MHD. With these, the client can break the HTTP protocol, so + this should never be used in production. The options are, + however, useful for testing HTTP clients against "broken" + server implementations. This argument must be followed by an + ‘unsigned int’, corresponding to an ‘enum + MHD_DisableSanityCheck’. + + Right now, no sanity checks can be disabled. + ‘MHD_OPTION_SOCK_ADDR’ Bind daemon to the supplied socket address. This option should be followed by a ‘struct sockaddr *’. If @@ -1066,6 +1077,10 @@ as the “Host” header is missing and is mandatory in HTTP 1.1, but it should succeed when interpreted with HTTP 1.0. + ‘MHD_RF_INSANITY_HEADER_CONTENT_LENGTH’ + Disable sanity check preventing clients from manually setting + the HTTP content length option. + -- Enumeration: MHD_ResponseOptions Response-specific options. Passed in the varargs portion of ‘MHD_set_response_options()’. @@ -4388,43 +4403,43 @@ * Menu: * ARM: microhttpd-intro. (line 274) -* bind, restricting bind: microhttpd-const. (line 321) -* bind, restricting bind <1>: microhttpd-const. (line 556) -* cipher: microhttpd-const. (line 394) +* bind, restricting bind: microhttpd-const. (line 332) +* bind, restricting bind <1>: microhttpd-const. (line 567) +* cipher: microhttpd-const. (line 405) * clock: microhttpd-const. (line 105) * compilation: microhttpd-intro. (line 121) * connection, limiting number of connections: microhttpd-const. (line 209) * connection, limiting number of connections <1>: microhttpd-info daemon. (line 60) -* cookie: microhttpd-const. (line 588) +* cookie: microhttpd-const. (line 599) * cortex m3: microhttpd-intro. (line 274) * date: microhttpd-const. (line 105) * debugging: microhttpd-const. (line 31) -* debugging <1>: microhttpd-const. (line 332) +* debugging <1>: microhttpd-const. (line 343) * deprecated: microhttpd-const. (line 61) -* DH: microhttpd-const. (line 548) -* digest auth: microhttpd-const. (line 433) -* digest auth <1>: microhttpd-const. (line 444) +* DH: microhttpd-const. (line 559) +* digest auth: microhttpd-const. (line 444) +* digest auth <1>: microhttpd-const. (line 455) * eCos, GNU General Public License with eCos Extension: eCos License. (line 6) * embedded systems: microhttpd-intro. (line 121) * embedded systems <1>: microhttpd-intro. (line 274) * embedded systems <2>: microhttpd-const. (line 105) * embedded systems <3>: microhttpd-const. (line 112) -* embedded systems <4>: microhttpd-const. (line 532) +* embedded systems <4>: microhttpd-const. (line 543) * epoll: microhttpd-intro. (line 67) * epoll <1>: microhttpd-const. (line 77) * epoll <2>: microhttpd-info daemon. (line 49) -* escaping: microhttpd-const. (line 515) +* escaping: microhttpd-const. (line 526) * FD_SETSIZE: microhttpd-const. (line 70) * FD_SETSIZE <1>: microhttpd-const. (line 77) -* foreign-function interface: microhttpd-const. (line 493) +* foreign-function interface: microhttpd-const. (line 504) * HTTP2: microhttpd-response upgrade. (line 6) * IAR: microhttpd-intro. (line 274) -* internationalization: microhttpd-const. (line 515) +* internationalization: microhttpd-const. (line 526) * IPv6: microhttpd-const. (line 45) * IPv6 <1>: microhttpd-const. (line 55) * license: GNU-LGPL. (line 6) @@ -4433,21 +4448,21 @@ * license <3>: GNU-FDL. (line 6) * listen: microhttpd-const. (line 112) * listen <1>: microhttpd-const. (line 143) -* listen <2>: microhttpd-const. (line 538) +* listen <2>: microhttpd-const. (line 549) * listen <3>: microhttpd-info daemon. (line 43) -* logging: microhttpd-const. (line 332) -* logging <1>: microhttpd-const. (line 474) +* logging: microhttpd-const. (line 343) +* logging <1>: microhttpd-const. (line 485) * long long: microhttpd-intro. (line 274) * memory: microhttpd-const. (line 201) * memory, limiting memory utilization: microhttpd-const. (line 193) * MHD_LONG_LONG: microhttpd-intro. (line 274) * microhttpd.h: microhttpd-intro. (line 214) -* OCSP: microhttpd-const. (line 417) -* options: microhttpd-const. (line 493) +* OCSP: microhttpd-const. (line 428) +* options: microhttpd-const. (line 504) * performance: microhttpd-intro. (line 91) * performance <1>: microhttpd-const. (line 90) -* performance <2>: microhttpd-const. (line 485) +* performance <2>: microhttpd-const. (line 496) * performance <3>: microhttpd-info conn. (line 114) * poll: microhttpd-intro. (line 67) @@ -4455,21 +4470,21 @@ * poll <2>: microhttpd-init. (line 74) * portability: microhttpd-intro. (line 121) * portability <1>: microhttpd-intro. (line 214) -* POST method: microhttpd-const. (line 592) +* POST method: microhttpd-const. (line 603) * POST method <1>: microhttpd-struct. (line 19) * POST method <2>: microhttpd-cb. (line 48) * POST method <3>: microhttpd-post. (line 6) * POST method <4>: microhttpd-post api. (line 6) * proxy: microhttpd-const. (line 112) -* PSK: microhttpd-const. (line 427) -* pthread: microhttpd-const. (line 532) +* PSK: microhttpd-const. (line 438) +* pthread: microhttpd-const. (line 543) * PUT method: microhttpd-cb. (line 48) -* query string: microhttpd-const. (line 332) +* query string: microhttpd-const. (line 343) * quiesce: microhttpd-const. (line 119) * quiesce <1>: microhttpd-init. (line 51) -* random: microhttpd-const. (line 433) -* replay attack: microhttpd-const. (line 444) -* reusing listening address: microhttpd-const. (line 556) +* random: microhttpd-const. (line 444) +* replay attack: microhttpd-const. (line 455) +* reusing listening address: microhttpd-const. (line 567) * RFC2817: microhttpd-response upgrade. (line 6) * select: microhttpd-intro. (line 67) @@ -4478,37 +4493,38 @@ * select <3>: microhttpd-init. (line 74) * select <4>: microhttpd-init. (line 89) * signals: microhttpd-intro. (line 235) -* SNI: microhttpd-const. (line 402) -* SNI <1>: microhttpd-const. (line 417) +* SNI: microhttpd-const. (line 413) +* SNI <1>: microhttpd-const. (line 428) * SSL: microhttpd-const. (line 34) -* SSL <1>: microhttpd-const. (line 355) -* SSL <2>: microhttpd-const. (line 361) -* SSL <3>: microhttpd-const. (line 371) -* SSL <4>: microhttpd-const. (line 377) -* SSL <5>: microhttpd-const. (line 389) -* SSL <6>: microhttpd-const. (line 394) -* SSL <7>: microhttpd-const. (line 402) -* SSL <8>: microhttpd-const. (line 417) -* SSL <9>: microhttpd-const. (line 427) -* SSL <10>: microhttpd-const. (line 548) -* stack: microhttpd-const. (line 532) -* systemd: microhttpd-const. (line 467) -* thread: microhttpd-const. (line 532) +* SSL <1>: microhttpd-const. (line 366) +* SSL <2>: microhttpd-const. (line 372) +* SSL <3>: microhttpd-const. (line 382) +* SSL <4>: microhttpd-const. (line 388) +* SSL <5>: microhttpd-const. (line 400) +* SSL <6>: microhttpd-const. (line 405) +* SSL <7>: microhttpd-const. (line 413) +* SSL <8>: microhttpd-const. (line 428) +* SSL <9>: microhttpd-const. (line 438) +* SSL <10>: microhttpd-const. (line 559) +* stack: microhttpd-const. (line 543) +* systemd: microhttpd-const. (line 478) +* testing: microhttpd-const. (line 321) +* thread: microhttpd-const. (line 543) * timeout: microhttpd-const. (line 247) * timeout <1>: microhttpd-inspect. (line 39) * timeout <2>: microhttpd-option conn. (line 6) * TLS: microhttpd-const. (line 34) -* TLS <1>: microhttpd-const. (line 355) -* TLS <2>: microhttpd-const. (line 361) -* TLS <3>: microhttpd-const. (line 371) -* TLS <4>: microhttpd-const. (line 377) -* TLS <5>: microhttpd-const. (line 389) -* TLS <6>: microhttpd-const. (line 394) -* TLS <7>: microhttpd-const. (line 402) -* TLS <8>: microhttpd-const. (line 417) -* TLS <9>: microhttpd-const. (line 427) -* TLS <10>: microhttpd-const. (line 548) +* TLS <1>: microhttpd-const. (line 366) +* TLS <2>: microhttpd-const. (line 372) +* TLS <3>: microhttpd-const. (line 382) +* TLS <4>: microhttpd-const. (line 388) +* TLS <5>: microhttpd-const. (line 400) +* TLS <6>: microhttpd-const. (line 405) +* TLS <7>: microhttpd-const. (line 413) +* TLS <8>: microhttpd-const. (line 428) +* TLS <9>: microhttpd-const. (line 438) +* TLS <10>: microhttpd-const. (line 559) * upgrade: microhttpd-const. (line 148) * Upgrade: microhttpd-response upgrade. (line 6) @@ -4639,58 +4655,58 @@ (line 6) * MHD_FLAG: microhttpd-const. (line 6) * MHD_OPTION: microhttpd-const. (line 184) -* MHD_OptionItem: microhttpd-const. (line 567) +* MHD_OptionItem: microhttpd-const. (line 578) * MHD_PostProcessor: microhttpd-struct. (line 18) -* MHD_RequestTerminationCode: microhttpd-const. (line 605) +* MHD_RequestTerminationCode: microhttpd-const. (line 616) * MHD_Response: microhttpd-struct. (line 15) -* MHD_ResponseFlags: microhttpd-const. (line 645) -* MHD_ResponseMemoryMode: microhttpd-const. (line 623) -* MHD_ResponseOptions: microhttpd-const. (line 686) +* MHD_ResponseFlags: microhttpd-const. (line 656) +* MHD_ResponseMemoryMode: microhttpd-const. (line 634) +* MHD_ResponseOptions: microhttpd-const. (line 701) * MHD_UpgradeAction: microhttpd-response upgrade. (line 101) -* MHD_ValueKind: microhttpd-const. (line 580) +* MHD_ValueKind: microhttpd-const. (line 591)  Tag Table: -Node: Top819 -Node: microhttpd-intro3132 -Ref: fig:performance8049 -Ref: tbl:supported9020 -Node: microhttpd-const16997 -Node: microhttpd-struct52230 -Node: microhttpd-cb53014 -Node: microhttpd-init63212 -Node: microhttpd-inspect69063 -Node: microhttpd-requests71807 -Node: microhttpd-responses75475 -Node: microhttpd-response enqueue76674 -Ref: microhttpd-response enqueue-Footnote-178981 -Node: microhttpd-response create79216 -Node: microhttpd-response headers85886 -Node: microhttpd-response options88318 -Node: microhttpd-response inspect89189 -Node: microhttpd-response upgrade90410 -Node: microhttpd-flow95744 -Node: microhttpd-dauth99038 -Node: microhttpd-dauth basic100589 -Node: microhttpd-dauth digest101983 -Node: microhttpd-post112179 -Node: microhttpd-post api115178 -Node: microhttpd-info117822 -Node: microhttpd-info daemon118244 -Node: microhttpd-info conn121704 -Node: microhttpd-option conn126763 -Node: microhttpd-util127843 -Node: microhttpd-util feature128114 -Node: microhttpd-util unescape131700 -Node: GNU-LGPL132348 -Node: eCos License160539 -Node: GNU-GPL161930 -Node: GNU-FDL181237 -Node: Concept Index206506 -Node: Function and Data Index215879 -Node: Type Index222402 +Node: Top817 +Node: microhttpd-intro3128 +Ref: fig:performance8045 +Ref: tbl:supported9016 +Node: microhttpd-const16993 +Node: microhttpd-struct52933 +Node: microhttpd-cb53717 +Node: microhttpd-init63915 +Node: microhttpd-inspect69766 +Node: microhttpd-requests72510 +Node: microhttpd-responses76178 +Node: microhttpd-response enqueue77377 +Ref: microhttpd-response enqueue-Footnote-179684 +Node: microhttpd-response create79919 +Node: microhttpd-response headers86589 +Node: microhttpd-response options89021 +Node: microhttpd-response inspect89892 +Node: microhttpd-response upgrade91113 +Node: microhttpd-flow96447 +Node: microhttpd-dauth99741 +Node: microhttpd-dauth basic101292 +Node: microhttpd-dauth digest102686 +Node: microhttpd-post112882 +Node: microhttpd-post api115881 +Node: microhttpd-info118525 +Node: microhttpd-info daemon118947 +Node: microhttpd-info conn122407 +Node: microhttpd-option conn127466 +Node: microhttpd-util128546 +Node: microhttpd-util feature128817 +Node: microhttpd-util unescape132403 +Node: GNU-LGPL133051 +Node: eCos License161242 +Node: GNU-GPL162633 +Node: GNU-FDL181940 +Node: Concept Index207209 +Node: Function and Data Index216655 +Node: Type Index223178  End Tag Table diff -Nru libmicrohttpd-0.9.67/doc/libmicrohttpd.texi libmicrohttpd-0.9.68/doc/libmicrohttpd.texi --- libmicrohttpd-0.9.67/doc/libmicrohttpd.texi 2019-09-15 10:52:41.000000000 +0000 +++ libmicrohttpd-0.9.68/doc/libmicrohttpd.texi 2019-10-25 21:35:10.000000000 +0000 @@ -776,6 +776,15 @@ It is not recommended to set it to -1 on publicly available servers as it may potentially lower level of protection. +@item MHD_OPTION_SERVER_INSANITY +@cindex testing +Allows the application to disable certain sanity precautions in MHD. With +these, the client can break the HTTP protocol, so this should never be used in +production. The options are, however, useful for testing HTTP clients against +"broken" server implementations. This argument must be followed by an +@code{unsigned int}, corresponding to an @code{enum MHD_DisableSanityCheck}. + +Right now, no sanity checks can be disabled. @item MHD_OPTION_SOCK_ADDR @cindex bind, restricting bind @@ -1207,6 +1216,11 @@ as the ``Host'' header is missing and is mandatory in HTTP 1.1, but it should succeed when interpreted with HTTP 1.0. + +@item MHD_RF_INSANITY_HEADER_CONTENT_LENGTH +Disable sanity check preventing clients from manually +setting the HTTP content length option. + @end table @end deftp diff -Nru libmicrohttpd-0.9.67/doc/libmicrohttpd-tutorial.info libmicrohttpd-0.9.68/doc/libmicrohttpd-tutorial.info --- libmicrohttpd-0.9.67/doc/libmicrohttpd-tutorial.info 2018-06-20 20:16:38.000000000 +0000 +++ libmicrohttpd-0.9.68/doc/libmicrohttpd-tutorial.info 2019-10-26 17:30:54.000000000 +0000 @@ -1,4 +1,4 @@ -This is libmicrohttpd-tutorial.info, produced by makeinfo version 6.5 +This is libmicrohttpd-tutorial.info, produced by makeinfo version 6.7 from libmicrohttpd-tutorial.texi. This tutorial documents GNU libmicrohttpd version 0.9.48, last updated 2 @@ -4182,12 +4182,10 @@ char *tmp; size_t length = strlen (message); - tmp = malloc (length * 2); + tmp = malloc (length * 2 + 1); if (NULL == tmp) - return tmp; - + return NULL; tmp[0] = 0; - for (i = 0; i < length; i += 3) { l = (((unsigned long) message[i]) << 16) @@ -4318,7 +4316,7 @@ const char *strbase = "Basic "; int authenticated; size_t slen; - + headervalue = MHD_lookup_connection_value (connection, MHD_HEADER_KIND, "Authorization"); @@ -4464,3 +4462,8 @@ Node: tlsauthentication.c151908  End Tag Table + + +Local Variables: +coding: utf-8 +End: diff -Nru libmicrohttpd-0.9.67/doc/stamp-vti libmicrohttpd-0.9.68/doc/stamp-vti --- libmicrohttpd-0.9.67/doc/stamp-vti 2019-10-17 15:01:51.000000000 +0000 +++ libmicrohttpd-0.9.68/doc/stamp-vti 2019-10-26 17:30:53.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 15 September 2019 -@set UPDATED-MONTH September 2019 -@set EDITION 0.9.67 -@set VERSION 0.9.67 +@set UPDATED 25 October 2019 +@set UPDATED-MONTH October 2019 +@set EDITION 0.9.68 +@set VERSION 0.9.68 diff -Nru libmicrohttpd-0.9.67/doc/version.texi libmicrohttpd-0.9.68/doc/version.texi --- libmicrohttpd-0.9.67/doc/version.texi 2019-10-17 15:01:51.000000000 +0000 +++ libmicrohttpd-0.9.68/doc/version.texi 2019-10-26 17:30:53.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 15 September 2019 -@set UPDATED-MONTH September 2019 -@set EDITION 0.9.67 -@set VERSION 0.9.67 +@set UPDATED 25 October 2019 +@set UPDATED-MONTH October 2019 +@set EDITION 0.9.68 +@set VERSION 0.9.68 diff -Nru libmicrohttpd-0.9.67/po/libmicrohttpd.pot libmicrohttpd-0.9.68/po/libmicrohttpd.pot --- libmicrohttpd-0.9.67/po/libmicrohttpd.pot 2019-10-17 15:01:51.000000000 +0000 +++ libmicrohttpd-0.9.68/po/libmicrohttpd.pot 2019-10-26 17:30:53.000000000 +0000 @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: GNU libmicrohttpd 0.9.67\n" +"Project-Id-Version: GNU libmicrohttpd 0.9.68\n" "Report-Msgid-Bugs-To: libmicrohttpd@gnu.org\n" -"POT-Creation-Date: 2019-10-17 17:01+0200\n" +"POT-Creation-Date: 2019-10-26 19:30+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -126,7 +126,7 @@ "unsupported.\n" msgstr "" -#: src/microhttpd/daemon.c:1348 src/microhttpd/daemon.c:6697 +#: src/microhttpd/daemon.c:1348 src/microhttpd/daemon.c:6704 msgid "" "Initiated daemon shutdown while \"upgraded\" connection was not closed.\n" msgstr "" @@ -184,7 +184,7 @@ msgid "PSK authentication failed: PSK too long\n" msgstr "" -#: src/microhttpd/daemon.c:2407 src/microhttpd/daemon.c:6334 +#: src/microhttpd/daemon.c:2407 src/microhttpd/daemon.c:6341 #, c-format msgid "Socket descriptor larger than FD_SETSIZE: %d > %d\n" msgstr "" @@ -194,7 +194,7 @@ msgid "Failed to set SO_NOSIGPIPE on accepted socket: %s\n" msgstr "" -#: src/microhttpd/daemon.c:2440 src/microhttpd/daemon.c:3298 +#: src/microhttpd/daemon.c:2440 src/microhttpd/daemon.c:3299 #, c-format msgid "Accepted connection on socket %d\n" msgstr "" @@ -208,7 +208,7 @@ msgstr "" #: src/microhttpd/daemon.c:2504 src/microhttpd/daemon.c:2524 -#: src/microhttpd/daemon.c:3885 +#: src/microhttpd/daemon.c:3886 #, c-format msgid "Error allocating memory: %s\n" msgstr "" @@ -222,10 +222,10 @@ msgid "Unknown credential type" msgstr "" -#: src/microhttpd/daemon.c:2714 src/microhttpd/daemon.c:4377 -#: src/microhttpd/daemon.c:4410 src/microhttpd/daemon.c:5615 -#: src/microhttpd/daemon.c:5632 src/microhttpd/connection.c:3795 -#: src/microhttpd/response.c:1044 src/microhttpd/response.c:1070 +#: src/microhttpd/daemon.c:2714 src/microhttpd/daemon.c:4378 +#: src/microhttpd/daemon.c:4411 src/microhttpd/daemon.c:5622 +#: src/microhttpd/daemon.c:5639 src/microhttpd/connection.c:3796 +#: src/microhttpd/response.c:1052 src/microhttpd/response.c:1078 #, c-format msgid "Call to epoll_ctl failed: %s\n" msgstr "" @@ -234,8 +234,8 @@ msgid "Failed to signal new connection via inter-thread communication channel." msgstr "" -#: src/microhttpd/daemon.c:2846 src/microhttpd/daemon.c:3382 -#: src/microhttpd/daemon.c:6584 src/microhttpd/connection.c:802 +#: src/microhttpd/daemon.c:2846 src/microhttpd/daemon.c:3383 +#: src/microhttpd/daemon.c:6591 src/microhttpd/connection.c:802 #: src/microhttpd/connection.c:821 msgid "Failed to remove FD from epoll set\n" msgstr "" @@ -293,334 +293,334 @@ "suspending accept(). Consider setting a lower MHD_OPTION_CONNECTION_LIMIT.\n" msgstr "" -#: src/microhttpd/daemon.c:3267 +#: src/microhttpd/daemon.c:3268 #, c-format msgid "Failed to disable TCP Nagle on socket: %s\n" msgstr "" -#: src/microhttpd/daemon.c:3278 +#: src/microhttpd/daemon.c:3279 #, c-format msgid "Failed to set nonblocking mode on incoming connection socket: %s\n" msgstr "" -#: src/microhttpd/daemon.c:3291 +#: src/microhttpd/daemon.c:3292 msgid "Failed to set noninheritable mode on incoming connection socket.\n" msgstr "" -#: src/microhttpd/daemon.c:3339 src/microhttpd/daemon.c:6741 -#: src/microhttpd/daemon.c:6773 src/microhttpd/daemon.c:6875 +#: src/microhttpd/daemon.c:3340 src/microhttpd/daemon.c:6748 +#: src/microhttpd/daemon.c:6780 src/microhttpd/daemon.c:6882 msgid "Failed to join a thread\n" msgstr "" -#: src/microhttpd/daemon.c:3443 +#: src/microhttpd/daemon.c:3444 msgid "Illegal call to MHD_get_timeout\n" msgstr "" -#: src/microhttpd/daemon.c:3640 +#: src/microhttpd/daemon.c:3641 msgid "" "MHD_run_from_select() called with except_fd_set set to NULL. Such behavior " "is deprecated.\n" msgstr "" -#: src/microhttpd/daemon.c:3720 +#: src/microhttpd/daemon.c:3721 msgid "Could not obtain daemon fdsets" msgstr "" -#: src/microhttpd/daemon.c:3737 +#: src/microhttpd/daemon.c:3738 msgid "Could not add listen socket to fdset" msgstr "" -#: src/microhttpd/daemon.c:3766 +#: src/microhttpd/daemon.c:3767 msgid "Could not add control inter-thread communication channel FD to fdset" msgstr "" -#: src/microhttpd/daemon.c:3822 +#: src/microhttpd/daemon.c:3823 #, c-format msgid "select failed: %s\n" msgstr "" -#: src/microhttpd/daemon.c:3967 src/microhttpd/daemon.c:4115 +#: src/microhttpd/daemon.c:3968 src/microhttpd/daemon.c:4116 #, c-format msgid "poll failed: %s\n" msgstr "" -#: src/microhttpd/daemon.c:4246 src/microhttpd/daemon.c:4477 +#: src/microhttpd/daemon.c:4247 src/microhttpd/daemon.c:4478 #, c-format msgid "Call to epoll_wait failed: %s\n" msgstr "" -#: src/microhttpd/daemon.c:4429 src/microhttpd/daemon.c:4887 +#: src/microhttpd/daemon.c:4430 src/microhttpd/daemon.c:4888 msgid "Failed to remove listen FD from epoll set\n" msgstr "" -#: src/microhttpd/daemon.c:4896 +#: src/microhttpd/daemon.c:4897 msgid "Failed to signal quiesce via inter-thread communication channel" msgstr "" -#: src/microhttpd/daemon.c:4919 +#: src/microhttpd/daemon.c:4920 msgid "failed to signal quiesce via inter-thread communication channel" msgstr "" -#: src/microhttpd/daemon.c:5033 +#: src/microhttpd/daemon.c:5034 msgid "Warning: Too large timeout value, ignored.\n" msgstr "" -#: src/microhttpd/daemon.c:5073 +#: src/microhttpd/daemon.c:5079 msgid "" "Warning: Zero size, specified for thread pool size, is ignored. Thread pool " "is not used.\n" msgstr "" -#: src/microhttpd/daemon.c:5082 +#: src/microhttpd/daemon.c:5088 msgid "" "Warning: \"1\", specified for thread pool size, is ignored. Thread pool is " "not used.\n" msgstr "" -#: src/microhttpd/daemon.c:5095 +#: src/microhttpd/daemon.c:5101 #, c-format msgid "Specified thread pool size (%u) too big\n" msgstr "" -#: src/microhttpd/daemon.c:5106 +#: src/microhttpd/daemon.c:5112 msgid "" "MHD_OPTION_THREAD_POOL_SIZE option is specified but " "MHD_USE_INTERNAL_POLLING_THREAD flag is not specified.\n" msgstr "" -#: src/microhttpd/daemon.c:5115 +#: src/microhttpd/daemon.c:5121 msgid "" "Both MHD_OPTION_THREAD_POOL_SIZE option and MHD_USE_THREAD_PER_CONNECTION " "flag are specified.\n" msgstr "" -#: src/microhttpd/daemon.c:5133 src/microhttpd/daemon.c:5146 -#: src/microhttpd/daemon.c:5159 src/microhttpd/daemon.c:5172 -#: src/microhttpd/daemon.c:5224 src/microhttpd/daemon.c:5253 -#: src/microhttpd/daemon.c:5274 src/microhttpd/daemon.c:5296 +#: src/microhttpd/daemon.c:5139 src/microhttpd/daemon.c:5152 +#: src/microhttpd/daemon.c:5165 src/microhttpd/daemon.c:5178 +#: src/microhttpd/daemon.c:5230 src/microhttpd/daemon.c:5259 +#: src/microhttpd/daemon.c:5280 src/microhttpd/daemon.c:5302 #, c-format msgid "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set\n" msgstr "" -#: src/microhttpd/daemon.c:5192 +#: src/microhttpd/daemon.c:5198 msgid "Error initializing DH parameters\n" msgstr "" -#: src/microhttpd/daemon.c:5202 +#: src/microhttpd/daemon.c:5208 msgid "Diffie-Hellman parameters string too long\n" msgstr "" -#: src/microhttpd/daemon.c:5213 +#: src/microhttpd/daemon.c:5219 msgid "Bad Diffie-Hellman parameters format\n" msgstr "" -#: src/microhttpd/daemon.c:5241 +#: src/microhttpd/daemon.c:5247 #, c-format msgid "Setting priorities to `%s' failed: %s\n" msgstr "" -#: src/microhttpd/daemon.c:5262 +#: src/microhttpd/daemon.c:5268 msgid "" "MHD_OPTION_HTTPS_CERT_CALLBACK requires building MHD with GnuTLS >= 3.0\n" msgstr "" -#: src/microhttpd/daemon.c:5284 +#: src/microhttpd/daemon.c:5290 msgid "" "MHD_OPTION_HTTPS_CERT_CALLBACK2 requires building MHD with GnuTLS >= 3.6.3\n" msgstr "" -#: src/microhttpd/daemon.c:5319 +#: src/microhttpd/daemon.c:5325 msgid "" "MHD_OPTION_LISTEN_SOCKET specified for daemon with MHD_USE_NO_LISTEN_SOCKET " "flag set.\n" msgstr "" -#: src/microhttpd/daemon.c:5355 +#: src/microhttpd/daemon.c:5361 msgid "TCP fastopen is not supported on this platform\n" msgstr "" -#: src/microhttpd/daemon.c:5374 +#: src/microhttpd/daemon.c:5380 msgid "" "Flag MHD_USE_PEDANTIC_CHECKS is ignored because another behavior is " "specified by MHD_OPTION_STRICT_CLIENT.\n" msgstr "" -#: src/microhttpd/daemon.c:5508 +#: src/microhttpd/daemon.c:5515 #, c-format msgid "MHD HTTPS option %d passed to MHD compiled without GNUtls >= 3\n" msgstr "" -#: src/microhttpd/daemon.c:5522 +#: src/microhttpd/daemon.c:5529 #, c-format msgid "MHD HTTPS option %d passed to MHD compiled without HTTPS support\n" msgstr "" -#: src/microhttpd/daemon.c:5529 +#: src/microhttpd/daemon.c:5536 #, c-format msgid "Invalid option %d! (Did you terminate the list with MHD_OPTION_END?)\n" msgstr "" -#: src/microhttpd/daemon.c:5559 +#: src/microhttpd/daemon.c:5566 #, c-format msgid "Call to epoll_create1 failed: %s\n" msgstr "" -#: src/microhttpd/daemon.c:5569 +#: src/microhttpd/daemon.c:5576 msgid "Failed to set noninheritable mode on epoll FD.\n" msgstr "" -#: src/microhttpd/daemon.c:5819 +#: src/microhttpd/daemon.c:5826 msgid "" "Warning: MHD_USE_THREAD_PER_CONNECTION must be used only with " "MHD_USE_INTERNAL_POLLING_THREAD. Flag MHD_USE_INTERNAL_POLLING_THREAD was " "added. Consider setting MHD_USE_INTERNAL_POLLING_THREAD explicitly.\n" msgstr "" -#: src/microhttpd/daemon.c:5867 +#: src/microhttpd/daemon.c:5874 msgid "Using debug build of libmicrohttpd.\n" msgstr "" -#: src/microhttpd/daemon.c:5881 +#: src/microhttpd/daemon.c:5888 #, c-format msgid "Failed to create inter-thread communication channel: %s\n" msgstr "" -#: src/microhttpd/daemon.c:5898 +#: src/microhttpd/daemon.c:5905 msgid "" "file descriptor for inter-thread communication channel exceeds maximum " "value\n" msgstr "" -#: src/microhttpd/daemon.c:5918 +#: src/microhttpd/daemon.c:5925 msgid "Specified value for NC_SIZE too large\n" msgstr "" -#: src/microhttpd/daemon.c:5932 +#: src/microhttpd/daemon.c:5939 #, c-format msgid "Failed to allocate memory for nonce-nc map: %s\n" msgstr "" -#: src/microhttpd/daemon.c:5949 +#: src/microhttpd/daemon.c:5956 msgid "MHD failed to initialize nonce-nc mutex\n" msgstr "" -#: src/microhttpd/daemon.c:5970 +#: src/microhttpd/daemon.c:5977 msgid "MHD thread pooling only works with MHD_USE_INTERNAL_POLLING_THREAD\n" msgstr "" -#: src/microhttpd/daemon.c:5994 +#: src/microhttpd/daemon.c:6001 #, c-format msgid "Failed to create socket for listening: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6015 src/microhttpd/daemon.c:6034 -#: src/microhttpd/daemon.c:6057 src/microhttpd/daemon.c:6095 -#: src/microhttpd/daemon.c:6173 src/microhttpd/daemon.c:6204 +#: src/microhttpd/daemon.c:6022 src/microhttpd/daemon.c:6041 +#: src/microhttpd/daemon.c:6064 src/microhttpd/daemon.c:6102 +#: src/microhttpd/daemon.c:6180 src/microhttpd/daemon.c:6211 #, c-format msgid "setsockopt failed: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6068 +#: src/microhttpd/daemon.c:6075 msgid "Cannot allow listening address reuse: SO_REUSEPORT not defined\n" msgstr "" -#: src/microhttpd/daemon.c:6104 +#: src/microhttpd/daemon.c:6111 msgid "" "Cannot disallow listening address reuse: SO_EXCLUSIVEADDRUSE not defined\n" msgstr "" -#: src/microhttpd/daemon.c:6184 +#: src/microhttpd/daemon.c:6191 #, c-format msgid "Failed to bind to port %u: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6215 +#: src/microhttpd/daemon.c:6222 #, c-format msgid "Failed to listen for connections: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6246 +#: src/microhttpd/daemon.c:6253 #, c-format msgid "Failed to get listen port number: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6257 +#: src/microhttpd/daemon.c:6264 msgid "" "Failed to get listen port number (`struct sockaddr_storage` too small!?)\n" msgstr "" -#: src/microhttpd/daemon.c:6298 +#: src/microhttpd/daemon.c:6305 msgid "Unknown address family!\n" msgstr "" -#: src/microhttpd/daemon.c:6311 +#: src/microhttpd/daemon.c:6318 #, c-format msgid "Failed to set nonblocking mode on listening socket: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6354 +#: src/microhttpd/daemon.c:6361 msgid "" "Combining MHD_USE_THREAD_PER_CONNECTION and MHD_USE_EPOLL is not supported.\n" msgstr "" -#: src/microhttpd/daemon.c:6368 src/microhttpd/daemon.c:6381 +#: src/microhttpd/daemon.c:6375 src/microhttpd/daemon.c:6388 msgid "MHD failed to initialize IP connection limit mutex\n" msgstr "" -#: src/microhttpd/daemon.c:6400 +#: src/microhttpd/daemon.c:6407 msgid "Failed to initialize TLS support\n" msgstr "" -#: src/microhttpd/daemon.c:6428 +#: src/microhttpd/daemon.c:6435 #, c-format msgid "Failed to create listen thread: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6477 +#: src/microhttpd/daemon.c:6484 #, c-format msgid "Failed to create worker inter-thread communication channel: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6489 +#: src/microhttpd/daemon.c:6496 msgid "" "File descriptor for worker inter-thread communication channel exceeds " "maximum value\n" msgstr "" -#: src/microhttpd/daemon.c:6514 +#: src/microhttpd/daemon.c:6521 msgid "MHD failed to initialize cleanup connection mutex\n" msgstr "" -#: src/microhttpd/daemon.c:6528 +#: src/microhttpd/daemon.c:6535 #, c-format msgid "Failed to create pool thread: %s\n" msgstr "" -#: src/microhttpd/daemon.c:6683 src/microhttpd/daemon.c:6716 +#: src/microhttpd/daemon.c:6690 src/microhttpd/daemon.c:6723 msgid "MHD_stop_daemon() called while we have suspended connections.\n" msgstr "" -#: src/microhttpd/daemon.c:6726 src/microhttpd/daemon.c:6857 +#: src/microhttpd/daemon.c:6733 src/microhttpd/daemon.c:6864 msgid "Failed to signal shutdown via inter-thread communication channel" msgstr "" -#: src/microhttpd/daemon.c:6819 +#: src/microhttpd/daemon.c:6826 msgid "Failed to signal shutdown via inter-thread communication channel." msgstr "" -#: src/microhttpd/daemon.c:7295 +#: src/microhttpd/daemon.c:7302 msgid "Failed to initialize winsock\n" msgstr "" -#: src/microhttpd/daemon.c:7298 +#: src/microhttpd/daemon.c:7305 msgid "Winsock version 2.2 is not available\n" msgstr "" -#: src/microhttpd/daemon.c:7306 src/microhttpd/daemon.c:7310 +#: src/microhttpd/daemon.c:7313 src/microhttpd/daemon.c:7317 msgid "Failed to initialise multithreading in libgcrypt\n" msgstr "" -#: src/microhttpd/daemon.c:7316 +#: src/microhttpd/daemon.c:7323 msgid "libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 or newer\n" msgstr "" @@ -640,149 +640,149 @@ msgid "Closing connection (application error generating response)\n" msgstr "" -#: src/microhttpd/connection.c:1653 +#: src/microhttpd/connection.c:1654 #, c-format msgid "" "Error processing request (HTTP response code is %u (`%s')). Closing " "connection.\n" msgstr "" -#: src/microhttpd/connection.c:1680 src/microhttpd/connection.c:2718 +#: src/microhttpd/connection.c:1681 src/microhttpd/connection.c:2719 msgid "Closing connection (failed to queue response)\n" msgstr "" -#: src/microhttpd/connection.c:1691 src/microhttpd/connection.c:3526 -#: src/microhttpd/connection.c:3635 +#: src/microhttpd/connection.c:1692 src/microhttpd/connection.c:3527 +#: src/microhttpd/connection.c:3636 msgid "Closing connection (failed to create response header)\n" msgstr "" -#: src/microhttpd/connection.c:1737 src/microhttpd/connection.c:2878 -#: src/microhttpd/connection.c:2946 src/microhttpd/connection.c:3299 +#: src/microhttpd/connection.c:1738 src/microhttpd/connection.c:2879 +#: src/microhttpd/connection.c:2947 src/microhttpd/connection.c:3300 #, c-format msgid "In function %s handling connection at state: %s\n" msgstr "" -#: src/microhttpd/connection.c:1955 +#: src/microhttpd/connection.c:1956 msgid "Not enough memory in pool to allocate header record!\n" msgstr "" -#: src/microhttpd/connection.c:2002 +#: src/microhttpd/connection.c:2003 msgid "Not enough memory in pool to parse cookies!\n" msgstr "" -#: src/microhttpd/connection.c:2233 src/microhttpd/connection.c:2435 +#: src/microhttpd/connection.c:2234 src/microhttpd/connection.c:2436 msgid "Application reported internal error, closing connection.\n" msgstr "" -#: src/microhttpd/connection.c:2300 src/microhttpd/connection.c:2379 +#: src/microhttpd/connection.c:2301 src/microhttpd/connection.c:2380 msgid "" "Received malformed HTTP request (bad chunked encoding). Closing connection.\n" msgstr "" -#: src/microhttpd/connection.c:2443 +#: src/microhttpd/connection.c:2444 msgid "libmicrohttpd API violation" msgstr "" -#: src/microhttpd/connection.c:2459 +#: src/microhttpd/connection.c:2460 msgid "" "WARNING: incomplete upload processing and connection not suspended may " "result in hung connection.\n" msgstr "" -#: src/microhttpd/connection.c:2531 +#: src/microhttpd/connection.c:2532 msgid "Received malformed line (no colon). Closing connection.\n" msgstr "" -#: src/microhttpd/connection.c:2694 +#: src/microhttpd/connection.c:2695 msgid "Received HTTP 1.1 request without `Host' header.\n" msgstr "" -#: src/microhttpd/connection.c:2706 +#: src/microhttpd/connection.c:2707 msgid "Closing connection (failed to create response)\n" msgstr "" -#: src/microhttpd/connection.c:2856 +#: src/microhttpd/connection.c:2857 msgid "Socket disconnected while reading request.\n" msgstr "" -#: src/microhttpd/connection.c:2863 +#: src/microhttpd/connection.c:2864 msgid "Connection socket is closed due to error when reading request.\n" msgstr "" -#: src/microhttpd/connection.c:2973 +#: src/microhttpd/connection.c:2974 #, c-format msgid "Failed to send data in request for %s.\n" msgstr "" -#: src/microhttpd/connection.c:2982 +#: src/microhttpd/connection.c:2983 #, c-format msgid "Sent 100 continue response: `%.*s'\n" msgstr "" -#: src/microhttpd/connection.c:3025 +#: src/microhttpd/connection.c:3026 msgid "Connection was closed while sending response headers.\n" msgstr "" -#: src/microhttpd/connection.c:3077 +#: src/microhttpd/connection.c:3078 msgid "Data offset exceeds limit" msgstr "" -#: src/microhttpd/connection.c:3087 +#: src/microhttpd/connection.c:3088 #, c-format msgid "Sent %d-byte DATA response: `%.*s'\n" msgstr "" -#: src/microhttpd/connection.c:3104 +#: src/microhttpd/connection.c:3105 #, c-format msgid "Failed to send data in request for `%s'.\n" msgstr "" -#: src/microhttpd/connection.c:3134 src/microhttpd/connection.c:3164 +#: src/microhttpd/connection.c:3135 src/microhttpd/connection.c:3165 msgid "Connection was closed while sending response body.\n" msgstr "" -#: src/microhttpd/connection.c:3187 +#: src/microhttpd/connection.c:3188 msgid "Internal error\n" msgstr "" -#: src/microhttpd/connection.c:3261 +#: src/microhttpd/connection.c:3262 msgid "" "Failed to signal end of connection via inter-thread communication channel" msgstr "" -#: src/microhttpd/connection.c:3984 +#: src/microhttpd/connection.c:3985 msgid "Attempted to queue response on wrong thread!\n" msgstr "" -#: src/microhttpd/connection.c:3996 +#: src/microhttpd/connection.c:3997 msgid "" "Attempted 'upgrade' connection on daemon without MHD_ALLOW_UPGRADE option!\n" msgstr "" -#: src/microhttpd/connection.c:4006 +#: src/microhttpd/connection.c:4007 msgid "Application used invalid status code for 'upgrade' response!\n" msgstr "" -#: src/microhttpd/response.c:906 +#: src/microhttpd/response.c:914 msgid "" "Invalid response for upgrade: application failed to set the 'Upgrade' " "header!\n" msgstr "" -#: src/microhttpd/response.c:947 +#: src/microhttpd/response.c:955 msgid "Failed to make loopback sockets non-blocking.\n" msgstr "" -#: src/microhttpd/response.c:966 +#: src/microhttpd/response.c:974 msgid "Failed to set SO_NOSIGPIPE on loopback sockets.\n" msgstr "" -#: src/microhttpd/response.c:986 +#: src/microhttpd/response.c:994 #, c-format msgid "Socketpair descriptor larger than FD_SETSIZE: %d > %d\n" msgstr "" -#: src/microhttpd/response.c:1067 +#: src/microhttpd/response.c:1075 msgid "Error cleaning up while handling epoll error" msgstr "" diff -Nru libmicrohttpd-0.9.67/src/examples/Makefile.am libmicrohttpd-0.9.68/src/examples/Makefile.am --- libmicrohttpd-0.9.67/src/examples/Makefile.am 2019-06-03 21:44:04.000000000 +0000 +++ libmicrohttpd-0.9.68/src/examples/Makefile.am 2019-10-26 16:26:35.000000000 +0000 @@ -20,6 +20,7 @@ benchmark_https \ chunked_example \ minimal_example \ + minimal_example_empty \ dual_stack_example \ minimal_example_comet \ querystring_example \ @@ -38,7 +39,9 @@ noinst_EXTRA_DIST = msgs_i18n.c if ENABLE_HTTPS -noinst_PROGRAMS += https_fileserver_example +noinst_PROGRAMS += \ + https_fileserver_example \ + minimal_example_empty_tls endif if HAVE_POSTPROCESSOR noinst_PROGRAMS += \ @@ -83,6 +86,16 @@ minimal_example_LDADD = \ $(top_builddir)/src/microhttpd/libmicrohttpd.la +minimal_example_empty_SOURCES = \ + minimal_example_empty.c +minimal_example_empty_LDADD = \ + $(top_builddir)/src/microhttpd/libmicrohttpd.la + +minimal_example_empty_tls_SOURCES = \ + minimal_example_empty_tls.c +minimal_example_empty_tls_LDADD = \ + $(top_builddir)/src/microhttpd/libmicrohttpd.la + upgrade_example_SOURCES = \ upgrade_example.c upgrade_example_CFLAGS = \ @@ -216,4 +229,4 @@ if HAVE_ZLIB http_compression_LDADD += -lz http_chunked_compression_LDADD += -lz -endif \ No newline at end of file +endif diff -Nru libmicrohttpd-0.9.67/src/examples/Makefile.in libmicrohttpd-0.9.68/src/examples/Makefile.in --- libmicrohttpd-0.9.67/src/examples/Makefile.in 2019-10-17 15:01:01.000000000 +0000 +++ libmicrohttpd-0.9.68/src/examples/Makefile.in 2019-10-26 17:30:34.000000000 +0000 @@ -91,9 +91,10 @@ @USE_COVERAGE_TRUE@am__append_1 = --coverage noinst_PROGRAMS = benchmark$(EXEEXT) benchmark_https$(EXEEXT) \ chunked_example$(EXEEXT) minimal_example$(EXEEXT) \ - dual_stack_example$(EXEEXT) minimal_example_comet$(EXEEXT) \ - querystring_example$(EXEEXT) timeout$(EXEEXT) \ - fileserver_example$(EXEEXT) fileserver_example_dirs$(EXEEXT) \ + minimal_example_empty$(EXEEXT) dual_stack_example$(EXEEXT) \ + minimal_example_comet$(EXEEXT) querystring_example$(EXEEXT) \ + timeout$(EXEEXT) fileserver_example$(EXEEXT) \ + fileserver_example_dirs$(EXEEXT) \ fileserver_example_external_select$(EXEEXT) \ refuse_post_example$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ $(am__EXEEXT_3) $(am__EXEEXT_4) $(am__EXEEXT_5) \ @@ -102,7 +103,10 @@ @MHD_HAVE_EPOLL_TRUE@am__append_2 = \ @MHD_HAVE_EPOLL_TRUE@ suspend_resume_epoll -@ENABLE_HTTPS_TRUE@am__append_3 = https_fileserver_example +@ENABLE_HTTPS_TRUE@am__append_3 = \ +@ENABLE_HTTPS_TRUE@ https_fileserver_example \ +@ENABLE_HTTPS_TRUE@ minimal_example_empty_tls + @HAVE_POSTPROCESSOR_TRUE@am__append_4 = \ @HAVE_POSTPROCESSOR_TRUE@ post_example @@ -159,7 +163,8 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @MHD_HAVE_EPOLL_TRUE@am__EXEEXT_1 = suspend_resume_epoll$(EXEEXT) -@ENABLE_HTTPS_TRUE@am__EXEEXT_2 = https_fileserver_example$(EXEEXT) +@ENABLE_HTTPS_TRUE@am__EXEEXT_2 = https_fileserver_example$(EXEEXT) \ +@ENABLE_HTTPS_TRUE@ minimal_example_empty_tls$(EXEEXT) @HAVE_POSTPROCESSOR_TRUE@am__EXEEXT_3 = post_example$(EXEEXT) @HAVE_POSIX_THREADS_TRUE@@HAVE_POSTPROCESSOR_TRUE@am__EXEEXT_4 = demo$(EXEEXT) @ENABLE_HTTPS_TRUE@@HAVE_POSIX_THREADS_TRUE@@HAVE_POSTPROCESSOR_TRUE@am__EXEEXT_5 = demo_https$(EXEEXT) @@ -256,6 +261,16 @@ minimal_example_comet_OBJECTS = $(am_minimal_example_comet_OBJECTS) minimal_example_comet_DEPENDENCIES = \ $(top_builddir)/src/microhttpd/libmicrohttpd.la +am_minimal_example_empty_OBJECTS = minimal_example_empty.$(OBJEXT) +minimal_example_empty_OBJECTS = $(am_minimal_example_empty_OBJECTS) +minimal_example_empty_DEPENDENCIES = \ + $(top_builddir)/src/microhttpd/libmicrohttpd.la +am_minimal_example_empty_tls_OBJECTS = \ + minimal_example_empty_tls.$(OBJEXT) +minimal_example_empty_tls_OBJECTS = \ + $(am_minimal_example_empty_tls_OBJECTS) +minimal_example_empty_tls_DEPENDENCIES = \ + $(top_builddir)/src/microhttpd/libmicrohttpd.la am_post_example_OBJECTS = post_example.$(OBJEXT) post_example_OBJECTS = $(am_post_example_OBJECTS) post_example_DEPENDENCIES = \ @@ -317,6 +332,8 @@ ./$(DEPDIR)/https_fileserver_example-https_fileserver_example.Po \ ./$(DEPDIR)/minimal_example.Po \ ./$(DEPDIR)/minimal_example_comet.Po \ + ./$(DEPDIR)/minimal_example_empty.Po \ + ./$(DEPDIR)/minimal_example_empty_tls.Po \ ./$(DEPDIR)/post_example.Po ./$(DEPDIR)/querystring_example.Po \ ./$(DEPDIR)/refuse_post_example.Po \ ./$(DEPDIR)/suspend_resume_epoll-suspend_resume_epoll.Po \ @@ -351,7 +368,9 @@ $(http_chunked_compression_SOURCES) \ $(http_compression_SOURCES) \ $(https_fileserver_example_SOURCES) $(minimal_example_SOURCES) \ - $(minimal_example_comet_SOURCES) $(post_example_SOURCES) \ + $(minimal_example_comet_SOURCES) \ + $(minimal_example_empty_SOURCES) \ + $(minimal_example_empty_tls_SOURCES) $(post_example_SOURCES) \ $(querystring_example_SOURCES) $(refuse_post_example_SOURCES) \ $(suspend_resume_epoll_SOURCES) $(timeout_SOURCES) \ $(upgrade_example_SOURCES) @@ -365,7 +384,9 @@ $(http_chunked_compression_SOURCES) \ $(http_compression_SOURCES) \ $(https_fileserver_example_SOURCES) $(minimal_example_SOURCES) \ - $(minimal_example_comet_SOURCES) $(post_example_SOURCES) \ + $(minimal_example_comet_SOURCES) \ + $(minimal_example_empty_SOURCES) \ + $(minimal_example_empty_tls_SOURCES) $(post_example_SOURCES) \ $(querystring_example_SOURCES) $(refuse_post_example_SOURCES) \ $(suspend_resume_epoll_SOURCES) $(timeout_SOURCES) \ $(upgrade_example_SOURCES) @@ -638,6 +659,18 @@ minimal_example_LDADD = \ $(top_builddir)/src/microhttpd/libmicrohttpd.la +minimal_example_empty_SOURCES = \ + minimal_example_empty.c + +minimal_example_empty_LDADD = \ + $(top_builddir)/src/microhttpd/libmicrohttpd.la + +minimal_example_empty_tls_SOURCES = \ + minimal_example_empty_tls.c + +minimal_example_empty_tls_LDADD = \ + $(top_builddir)/src/microhttpd/libmicrohttpd.la + upgrade_example_SOURCES = \ upgrade_example.c @@ -897,6 +930,14 @@ @rm -f minimal_example_comet$(EXEEXT) $(AM_V_CCLD)$(LINK) $(minimal_example_comet_OBJECTS) $(minimal_example_comet_LDADD) $(LIBS) +minimal_example_empty$(EXEEXT): $(minimal_example_empty_OBJECTS) $(minimal_example_empty_DEPENDENCIES) $(EXTRA_minimal_example_empty_DEPENDENCIES) + @rm -f minimal_example_empty$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(minimal_example_empty_OBJECTS) $(minimal_example_empty_LDADD) $(LIBS) + +minimal_example_empty_tls$(EXEEXT): $(minimal_example_empty_tls_OBJECTS) $(minimal_example_empty_tls_DEPENDENCIES) $(EXTRA_minimal_example_empty_tls_DEPENDENCIES) + @rm -f minimal_example_empty_tls$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(minimal_example_empty_tls_OBJECTS) $(minimal_example_empty_tls_LDADD) $(LIBS) + post_example$(EXEEXT): $(post_example_OBJECTS) $(post_example_DEPENDENCIES) $(EXTRA_post_example_DEPENDENCIES) @rm -f post_example$(EXEEXT) $(AM_V_CCLD)$(LINK) $(post_example_OBJECTS) $(post_example_LDADD) $(LIBS) @@ -943,6 +984,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/https_fileserver_example-https_fileserver_example.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minimal_example.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minimal_example_comet.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minimal_example_empty.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minimal_example_empty_tls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/post_example.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/querystring_example.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refuse_post_example.Po@am__quote@ # am--include-marker @@ -1298,6 +1341,8 @@ -rm -f ./$(DEPDIR)/https_fileserver_example-https_fileserver_example.Po -rm -f ./$(DEPDIR)/minimal_example.Po -rm -f ./$(DEPDIR)/minimal_example_comet.Po + -rm -f ./$(DEPDIR)/minimal_example_empty.Po + -rm -f ./$(DEPDIR)/minimal_example_empty_tls.Po -rm -f ./$(DEPDIR)/post_example.Po -rm -f ./$(DEPDIR)/querystring_example.Po -rm -f ./$(DEPDIR)/refuse_post_example.Po @@ -1365,6 +1410,8 @@ -rm -f ./$(DEPDIR)/https_fileserver_example-https_fileserver_example.Po -rm -f ./$(DEPDIR)/minimal_example.Po -rm -f ./$(DEPDIR)/minimal_example_comet.Po + -rm -f ./$(DEPDIR)/minimal_example_empty.Po + -rm -f ./$(DEPDIR)/minimal_example_empty_tls.Po -rm -f ./$(DEPDIR)/post_example.Po -rm -f ./$(DEPDIR)/querystring_example.Po -rm -f ./$(DEPDIR)/refuse_post_example.Po diff -Nru libmicrohttpd-0.9.67/src/examples/minimal_example_empty.c libmicrohttpd-0.9.68/src/examples/minimal_example_empty.c --- libmicrohttpd-0.9.67/src/examples/minimal_example_empty.c 1970-01-01 00:00:00.000000000 +0000 +++ libmicrohttpd-0.9.68/src/examples/minimal_example_empty.c 2019-10-24 10:46:26.000000000 +0000 @@ -0,0 +1,94 @@ +/* + This file is part of libmicrohttpd + Copyright (C) 2007 Christian Grothoff (and other contributing authors) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ +/** + * @file minimal_example.c + * @brief minimal example for how to use libmicrohttpd + * @author Christian Grothoff + */ + +#include "platform.h" +#include + + +static int +ahc_echo (void *cls, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + size_t *upload_data_size, + void **ptr) +{ + static int aptr; + struct MHD_Response *response; + int ret; + + (void) url; /* Unused. Silent compiler warning. */ + (void) version; /* Unused. Silent compiler warning. */ + (void) upload_data; /* Unused. Silent compiler warning. */ + (void) upload_data_size; /* Unused. Silent compiler warning. */ + + if (0 != strcmp (method, "GET")) + return MHD_NO; /* unexpected method */ + if (&aptr != *ptr) + { + /* do never respond on first call */ + *ptr = &aptr; + return MHD_YES; + } + *ptr = NULL; /* reset when done */ + response = MHD_create_response_from_buffer (0, + NULL, + MHD_RESPMEM_PERSISTENT); + ret = MHD_queue_response (connection, + MHD_HTTP_NO_CONTENT, + response); + MHD_destroy_response (response); + return ret; +} + + +int +main (int argc, + char *const *argv) +{ + struct MHD_Daemon *d; + + if (argc != 2) + { + printf ("%s PORT\n", argv[0]); + return 1; + } + d = MHD_start_daemon (/* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */ + MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, + /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */ + /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */ + /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */ + atoi (argv[1]), + NULL, NULL, &ahc_echo, NULL, + MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120, + MHD_OPTION_STRICT_FOR_CLIENT, (int) 1, + MHD_OPTION_END); + if (d == NULL) + return 1; + (void) getc (stdin); + MHD_stop_daemon (d); + return 0; +} diff -Nru libmicrohttpd-0.9.67/src/examples/minimal_example_empty_tls.c libmicrohttpd-0.9.68/src/examples/minimal_example_empty_tls.c --- libmicrohttpd-0.9.67/src/examples/minimal_example_empty_tls.c 1970-01-01 00:00:00.000000000 +0000 +++ libmicrohttpd-0.9.68/src/examples/minimal_example_empty_tls.c 2019-10-26 16:25:56.000000000 +0000 @@ -0,0 +1,150 @@ +/* + This file is part of libmicrohttpd + Copyright (C) 2007 Christian Grothoff (and other contributing authors) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ +/** + * @file minimal_example_empty_ssl.c + * @brief minimal example for how to use libmicrohttpd + * @author Christian Grothoff + */ + +#include "platform.h" +#include + + +static int +ahc_echo (void *cls, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + size_t *upload_data_size, + void **ptr) +{ + static int aptr; + struct MHD_Response *response; + int ret; + + (void) url; /* Unused. Silent compiler warning. */ + (void) version; /* Unused. Silent compiler warning. */ + (void) upload_data; /* Unused. Silent compiler warning. */ + (void) upload_data_size; /* Unused. Silent compiler warning. */ + + if (0 != strcmp (method, "GET")) + return MHD_NO; /* unexpected method */ + if (&aptr != *ptr) + { + /* do never respond on first call */ + *ptr = &aptr; + return MHD_YES; + } + *ptr = NULL; /* reset when done */ + response = MHD_create_response_from_buffer (0, + NULL, + MHD_RESPMEM_PERSISTENT); + ret = MHD_queue_response (connection, + MHD_HTTP_NO_CONTENT, + response); + MHD_destroy_response (response); + return ret; +} + + +/* test server key */ +const char srv_signed_key_pem[] = "-----BEGIN RSA PRIVATE KEY-----\n" + "MIIEowIBAAKCAQEAvfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW\n" + "+K03KwEku55QvnUndwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8IL\n" + "q4sw32vo0fbMu5BZF49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ0\n" + "20Q5EAAEseD1YtWCIpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6\n" + "QYGGh1QmHRPAy3CBII6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6x\n" + "yoOl204xuekZOaG9RUPId74Rtmwfi1TLbBzo2wIDAQABAoIBADu09WSICNq5cMe4\n" + "+NKCLlgAT1NiQpLls1gKRbDhKiHU9j8QWNvWWkJWrCya4QdUfLCfeddCMeiQmv3K\n" + "lJMvDs+5OjJSHFoOsGiuW2Ias7IjnIojaJalfBml6frhJ84G27IXmdz6gzOiTIer\n" + "DjeAgcwBaKH5WwIay2TxIaScl7AwHBauQkrLcyb4hTmZuQh6ArVIN6+pzoVuORXM\n" + "bpeNWl2l/HSN3VtUN6aCAKbN/X3o0GavCCMn5Fa85uJFsab4ss/uP+2PusU71+zP\n" + "sBm6p/2IbGvF5k3VPDA7X5YX61sukRjRBihY8xSnNYx1UcoOsX6AiPnbhifD8+xQ\n" + "Tlf8oJUCgYEA0BTfzqNpr9Wxw5/QXaSdw7S/0eP5a0C/nwURvmfSzuTD4equzbEN\n" + "d+dI/s2JMxrdj/I4uoAfUXRGaabevQIjFzC9uyE3LaOyR2zhuvAzX+vVcs6bSXeU\n" + "pKpCAcN+3Z3evMaX2f+z/nfSUAl2i4J2R+/LQAWJW4KwRky/m+cxpfUCgYEA6bN1\n" + "b73bMgM8wpNt6+fcmS+5n0iZihygQ2U2DEud8nZJL4Nrm1dwTnfZfJBnkGj6+0Q0\n" + "cOwj2KS0/wcEdJBP0jucU4v60VMhp75AQeHqidIde0bTViSRo3HWKXHBIFGYoU3T\n" + "LyPyKndbqsOObnsFXHn56Nwhr2HLf6nw4taGQY8CgYBoSW36FLCNbd6QGvLFXBGt\n" + "2lMhEM8az/K58kJ4WXSwOLtr6MD/WjNT2tkcy0puEJLm6BFCd6A6pLn9jaKou/92\n" + "SfltZjJPb3GUlp9zn5tAAeSSi7YMViBrfuFiHObij5LorefBXISLjuYbMwL03MgH\n" + "Ocl2JtA2ywMp2KFXs8GQWQKBgFyIVv5ogQrbZ0pvj31xr9HjqK6d01VxIi+tOmpB\n" + "4ocnOLEcaxX12BzprW55ytfOCVpF1jHD/imAhb3YrHXu0fwe6DXYXfZV4SSG2vB7\n" + "IB9z14KBN5qLHjNGFpMQXHSMek+b/ftTU0ZnPh9uEM5D3YqRLVd7GcdUhHvG8P8Q\n" + "C9aXAoGBAJtID6h8wOGMP0XYX5YYnhlC7dOLfk8UYrzlp3xhqVkzKthTQTj6wx9R\n" + "GtC4k7U1ki8oJsfcIlBNXd768fqDVWjYju5rzShMpo8OCTS6ipAblKjCxPPVhIpv\n" + "tWPlbSn1qj6wylstJ5/3Z+ZW5H4wIKp5jmLiioDhcP0L/Ex3Zx8O\n" + "-----END RSA PRIVATE KEY-----\n"; + +/* test server CA signed certificates */ +const char srv_signed_cert_pem[] = "-----BEGIN CERTIFICATE-----\n" + "MIIDGzCCAgWgAwIBAgIES0KCvTALBgkqhkiG9w0BAQUwFzEVMBMGA1UEAxMMdGVz\n" + "dF9jYV9jZXJ0MB4XDTEwMDEwNTAwMDcyNVoXDTQ1MDMxMjAwMDcyNVowFzEVMBMG\n" + "A1UEAxMMdGVzdF9jYV9jZXJ0MIIBHzALBgkqhkiG9w0BAQEDggEOADCCAQkCggEA\n" + "vfTdv+3fgvVTKRnP/HVNG81cr8TrUP/iiyuve/THMzvFXhCW+K03KwEku55QvnUn\n" + "dwBfU/ROzLlv+5hotgiDRNFT3HxurmhouySBrJNJv7qWp8ILq4sw32vo0fbMu5BZ\n" + "F49bUXK9L3kW2PdhTtSQPWHEzNrCxO+YgCilKHkY3vQNfdJ020Q5EAAEseD1YtWC\n" + "IpRvJzYlZMpjYB1ubTl24kwrgOKUJYKqM4jmF4DVQp4oOK/6QYGGh1QmHRPAy3CB\n" + "II6sbb+sZT9cAqU6GYQVB35lm4XAgibXV6KgmpVxVQQ69U6xyoOl204xuekZOaG9\n" + "RUPId74Rtmwfi1TLbBzo2wIDAQABo3YwdDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQM\n" + "MAoGCCsGAQUFBwMBMA8GA1UdDwEB/wQFAwMHIAAwHQYDVR0OBBYEFOFi4ilKOP1d\n" + "XHlWCMwmVKr7mgy8MB8GA1UdIwQYMBaAFP2olB4s2T/xuoQ5pT2RKojFwZo2MAsG\n" + "CSqGSIb3DQEBBQOCAQEAHVWPxazupbOkG7Did+dY9z2z6RjTzYvurTtEKQgzM2Vz\n" + "GQBA+3pZ3c5mS97fPIs9hZXfnQeelMeZ2XP1a+9vp35bJjZBBhVH+pqxjCgiUflg\n" + "A3Zqy0XwwVCgQLE2HyaU3DLUD/aeIFK5gJaOSdNTXZLv43K8kl4cqDbMeRpVTbkt\n" + "YmG4AyEOYRNKGTqMEJXJoxD5E3rBUNrVI/XyTjYrulxbNPcMWEHKNeeqWpKDYTFo\n" + "Bb01PCthGXiq/4A2RLAFosadzRa8SBpoSjPPfZ0b2w4MJpReHqKbR5+T2t6hzml6\n" + "4ToyOKPDmamiTuN5KzLN3cw7DQlvWMvqSOChPLnA3Q==\n" + "-----END CERTIFICATE-----\n"; + + +int +main (int argc, + char *const *argv) +{ + struct MHD_Daemon *d; + + if (argc != 2) + { + printf ("%s PORT\n", argv[0]); + return 1; + } + d = MHD_start_daemon (/* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */ + MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG + | MHD_USE_TLS, + /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */ + /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */ + /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */ + atoi (argv[1]), + NULL, NULL, &ahc_echo, NULL, + MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120, + MHD_OPTION_STRICT_FOR_CLIENT, (int) 1, + /* Optionally, the gnutls_load_file() can be used to + load the key and the certificate from file. */ + MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem, + MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem, + MHD_OPTION_END); + if (d == NULL) + return 1; + (void) getc (stdin); + MHD_stop_daemon (d); + return 0; +} diff -Nru libmicrohttpd-0.9.67/src/include/microhttpd.h libmicrohttpd-0.9.68/src/include/microhttpd.h --- libmicrohttpd-0.9.67/src/include/microhttpd.h 2019-10-17 15:00:30.000000000 +0000 +++ libmicrohttpd-0.9.68/src/include/microhttpd.h 2019-10-26 17:30:40.000000000 +0000 @@ -132,7 +132,7 @@ * Current version of the library. * 0x01093001 = 1.9.30-1. */ -#define MHD_VERSION 0x00096701 +#define MHD_VERSION 0x00096800 /** * MHD-internal return code for "YES". @@ -1691,10 +1691,35 @@ * followed by a argument of type `gnutls_certificate_retrieve_function3 *`. * This option provides an * alternative/extension to #MHD_OPTION_HTTPS_CERT_CALLBACK. - * You must use this version if you want to use OCSP stapling. + * You must use this version if you want to use OCSP stapling. * Using this option requires GnuTLS 3.6.3 or higher. */ - MHD_OPTION_HTTPS_CERT_CALLBACK2 = 31 + MHD_OPTION_HTTPS_CERT_CALLBACK2 = 31, + + /** + * Allows the application to disable certain sanity precautions + * in MHD. With these, the client can break the HTTP protocol, + * so this should never be used in production. The options are, + * however, useful for testing HTTP clients against "broken" + * server implementations. + * This argument must be followed by an "unsigned int", corresponding + * to an `enum MHD_DisableSanityCheck`. + */ + MHD_OPTION_SERVER_INSANITY = 32 +}; + + +/** + * Bitfield for the #MHD_OPTION_SERVER_INSANITY specifying + * which santiy checks should be disabled. + */ +enum MHD_DisableSanityCheck +{ + /** + * All sanity checks are enabled. + */ + MHD_DSC_SANE = 0 + }; @@ -2924,7 +2949,14 @@ * #MHD_RF_HTTP_VERSION_1_0_ONLY flag, the response's HTTP version will * always be set to 1.0 and "Connection" headers are still supported. */ - MHD_RF_HTTP_VERSION_1_0_RESPONSE = 2 + MHD_RF_HTTP_VERSION_1_0_RESPONSE = 2, + + /** + * Disable sanity check preventing clients from manually + * setting the HTTP content length option. + */ + MHD_RF_INSANITY_HEADER_CONTENT_LENGTH = 4 + }; diff -Nru libmicrohttpd-0.9.67/src/microhttpd/connection.c libmicrohttpd-0.9.68/src/microhttpd/connection.c --- libmicrohttpd-0.9.67/src/microhttpd/connection.c 2019-10-17 14:57:41.000000000 +0000 +++ libmicrohttpd-0.9.68/src/microhttpd/connection.c 2019-10-25 21:35:10.000000000 +0000 @@ -350,12 +350,12 @@ if (NULL == iterator) for (pos = connection->headers_received; NULL != pos; pos = pos->next) { - if (kind == pos->kind) + if (0 != (kind & pos->kind)) ret++; } else for (pos = connection->headers_received; NULL != pos; pos = pos->next) - if (kind == pos->kind) + if (0 != (kind & pos->kind)) { ret++; if (MHD_NO == iterator (iterator_cls, @@ -1268,11 +1268,11 @@ bool response_has_close; bool response_has_keepalive; const char *have_encoding; - int must_add_close; - int must_add_chunked_encoding; - int must_add_keep_alive; - int must_add_content_length; - int may_add_content_length; + bool must_add_close; + bool must_add_chunked_encoding; + bool must_add_keep_alive; + bool must_add_content_length; + bool may_add_content_length; mhd_assert (NULL != connection->version); if (0 == connection->version[0]) @@ -1328,10 +1328,10 @@ /* calculate extra headers we need to add, such as 'Connection: close', first see what was explicitly requested by the application */ - must_add_close = MHD_NO; - must_add_chunked_encoding = MHD_NO; - must_add_keep_alive = MHD_NO; - must_add_content_length = MHD_NO; + must_add_close = false; + must_add_chunked_encoding = false; + must_add_keep_alive = false; + must_add_content_length = false; response_has_close = false; switch (connection->state) { @@ -1359,9 +1359,9 @@ have_encoding = MHD_get_response_header (response, MHD_HTTP_HEADER_TRANSFER_ENCODING); if (NULL == have_encoding) - may_add_content_length = MHD_YES; + may_add_content_length = true; else - may_add_content_length = MHD_NO; /* RFC 7230, Section 3.3.2 forbids header */ + may_add_content_length = false; /* RFC 7230, Section 3.3.2 forbids header */ if ( (MHD_SIZE_UNKNOWN == response->total_size) && #ifdef UPGRADE_SUPPORT (NULL == response->upgrade_handler) && @@ -1380,7 +1380,7 @@ { if (NULL == have_encoding) { - must_add_chunked_encoding = MHD_YES; + must_add_chunked_encoding = true; connection->have_chunked_upload = true; } else @@ -1389,7 +1389,7 @@ "identity")) { /* application forced identity encoding, can't do 'chunked' */ - must_add_close = MHD_YES; + must_add_close = true; } else { @@ -1402,7 +1402,7 @@ /* Keep alive or chunking not possible => set close header if not present */ if (! response_has_close) - must_add_close = MHD_YES; + must_add_close = true; } } @@ -1415,14 +1415,14 @@ (NULL == response->upgrade_handler) && #endif /* UPGRADE_SUPPORT */ (0 == (response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) ) - must_add_close = MHD_YES; + must_add_close = true; /* check if we must add 'close' header because we cannot add content-length because it is forbidden AND we don't have a 'chunked' encoding */ if ( (! may_add_content_length) && (! connection->have_chunked_upload) && (! response_has_close) ) - must_add_close = MHD_YES; + must_add_close = true; /* #MHD_HTTP_NO_CONTENT, #MHD_HTTP_NOT_MODIFIED and 1xx-status codes SHOULD NOT have a Content-Length according to spec; also chunked encoding / unknown length or CONNECT... */ @@ -1430,8 +1430,9 @@ (MHD_HTTP_NO_CONTENT != rc) && (MHD_HTTP_NOT_MODIFIED != rc) && (MHD_HTTP_OK <= rc) && - (NULL == /* this should always succeed due to check in - MHD_add_response_header() */ + (NULL == /* this COULD fail if the check in + MHD_add_response_header() was bypassed + via #MHD_RF_INSANITY_HEADER_CONTENT_LENGTH */ MHD_get_response_header (response, MHD_HTTP_HEADER_CONTENT_LENGTH)) && (may_add_content_length) && @@ -1460,19 +1461,19 @@ MHD_HTTP_HEADER_CONTENT_LENGTH ": " MHD_UNSIGNED_LONG_LONG_PRINTF "\r\n", (MHD_UNSIGNED_LONG_LONG) response->total_size); - must_add_content_length = MHD_YES; + must_add_content_length = true; } /* check for adding keep alive */ if ( (! response_has_keepalive) && (! response_has_close) && - (MHD_NO == must_add_close) && + (! must_add_close) && (MHD_CONN_MUST_CLOSE != connection->keepalive) && #ifdef UPGRADE_SUPPORT (NULL == response->upgrade_handler) && #endif /* UPGRADE_SUPPORT */ (MHD_YES == keepalive_possible (connection)) ) - must_add_keep_alive = MHD_YES; + must_add_keep_alive = true; break; case MHD_CONNECTION_BODY_SENT: response_has_keepalive = false; @@ -1505,7 +1506,7 @@ { /* TODO: add proper support for excluding "Keep-Alive" token. */ if ( (pos->kind == kind) && - (! ( (MHD_YES == must_add_close) && + (! ( (must_add_close) && (response_has_keepalive) && (pos->header_size == MHD_STATICSTR_LEN_ ( MHD_HTTP_HEADER_CONNECTION)) && @@ -1571,7 +1572,7 @@ { /* TODO: add proper support for excluding "Keep-Alive" token. */ if ( (pos->kind == kind) && - (! ( (MHD_YES == must_add_close) && + (! ( (must_add_close) && (response_has_keepalive) && (pos->header_size == MHD_STATICSTR_LEN_ ( MHD_HTTP_HEADER_CONNECTION)) && diff -Nru libmicrohttpd-0.9.67/src/microhttpd/daemon.c libmicrohttpd-0.9.68/src/microhttpd/daemon.c --- libmicrohttpd-0.9.67/src/microhttpd/daemon.c 2019-10-17 14:55:53.000000000 +0000 +++ libmicrohttpd-0.9.68/src/microhttpd/daemon.c 2019-10-25 21:35:10.000000000 +0000 @@ -2182,7 +2182,7 @@ MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN : MHD_REQUEST_TERMINATED_WITH_ERROR); MHD_connection_handle_idle (con); -exit: + exit: if (NULL != con->response) { MHD_destroy_response (con->response); @@ -2742,7 +2742,7 @@ #endif } return MHD_YES; -cleanup: + cleanup: if (NULL != daemon->notify_connection) daemon->notify_connection (daemon->notify_connection_cls, connection, @@ -3124,10 +3124,10 @@ _ ("Failed to set nonblocking mode on new client socket: %s\n"), MHD_socket_last_strerr_ ()); #endif - sk_nonbl = 0; + sk_nonbl = false; } else - sk_nonbl = ! 0; + sk_nonbl = true; if ( (0 != (daemon->options & MHD_USE_TURBO)) && (! MHD_socket_noninheritable_ (client_socket)) ) @@ -3200,7 +3200,7 @@ s = accept (fd, addr, &addrlen); - sk_nonbl = 0; + sk_nonbl = false; #endif /* ! USE_ACCEPT4 */ if ( (MHD_INVALID_SOCKET == s) || (addrlen <= 0) ) @@ -3259,8 +3259,9 @@ #if defined(MHD_TCP_CORK_NOPUSH) || defined(HAVE_MSG_MORE) /* We will use TCP_CORK or TCP_NOPUSH or MSG_MORE to control transmission, disable Nagle's algorithm (always) */ - if (0 != MHD_socket_set_nodelay_ (s, - true)) + if ( (0 != MHD_socket_set_nodelay_ (s, + true)) && + (EOPNOTSUPP != errno) ) { #ifdef HAVE_MESSAGES MHD_DLOG (daemon, @@ -3280,7 +3281,7 @@ #endif } else - sk_nonbl = ! 0; + sk_nonbl = true; #endif /* !USE_ACCEPT4 || !HAVE_SOCK_NONBLOCK */ #if ! defined(USE_ACCEPT4) || ! defined(SOCK_CLOEXEC) if (! MHD_socket_noninheritable_ (s)) @@ -5061,6 +5062,11 @@ daemon->uri_log_callback_cls = va_arg (ap, void *); break; + case MHD_OPTION_SERVER_INSANITY: + daemon->insanity_level = (enum MHD_DisableSanityCheck) + va_arg (ap, + unsigned int); + break; #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) case MHD_OPTION_THREAD_POOL_SIZE: daemon->worker_pool_size = va_arg (ap, @@ -5403,6 +5409,7 @@ case MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE: case MHD_OPTION_LISTENING_ADDRESS_REUSE: case MHD_OPTION_LISTEN_BACKLOG_SIZE: + case MHD_OPTION_SERVER_INSANITY: if (MHD_YES != parse_options (daemon, servaddr, opt, @@ -6546,7 +6553,7 @@ return daemon; #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) -thread_failed: + thread_failed: /* If no worker threads created, then shut down normally. Calling MHD_stop_daemon (as we do below) doesn't work here since it assumes a 0-sized thread pool means we had been in the default @@ -6570,7 +6577,7 @@ return NULL; #endif -free_and_fail: + free_and_fail: /* clean up basic memory state in 'daemon' and return NULL to indicate failure */ #ifdef EPOLL_SUPPORT diff -Nru libmicrohttpd-0.9.67/src/microhttpd/internal.h libmicrohttpd-0.9.68/src/microhttpd/internal.h --- libmicrohttpd-0.9.67/src/microhttpd/internal.h 2019-10-17 14:55:53.000000000 +0000 +++ libmicrohttpd-0.9.68/src/microhttpd/internal.h 2019-10-25 21:35:10.000000000 +0000 @@ -874,7 +874,7 @@ /** * true if #socket_fd is non-blocking, false otherwise. */ - bool sk_nonblck; // FIXME: hopefully dead? + bool sk_nonblck; /** * Indicate whether connection socket has TCP_CORK / Nagle’s algorithm turned on/off @@ -1461,6 +1461,12 @@ size_t thread_stack_size; /** + * Our #MHD_OPTION_SERVER_INSANITY level, bits indicating + * which sanity checks are off. + */ + enum MHD_DisableSanityCheck insanity_level; + + /** * Number of worker daemons */ unsigned int worker_pool_size; diff -Nru libmicrohttpd-0.9.67/src/microhttpd/mhd_send.c libmicrohttpd-0.9.68/src/microhttpd/mhd_send.c --- libmicrohttpd-0.9.67/src/microhttpd/mhd_send.c 2019-10-17 14:55:53.000000000 +0000 +++ libmicrohttpd-0.9.68/src/microhttpd/mhd_send.c 2019-10-26 16:51:50.000000000 +0000 @@ -240,7 +240,8 @@ ssize_t ret; /* error handling from send_param_adapter() */ - if ((MHD_INVALID_SOCKET == s) || (MHD_CONNECTION_CLOSED == connection->state)) + if ( (MHD_INVALID_SOCKET == s) || + (MHD_CONNECTION_CLOSED == connection->state) ) { return MHD_ERR_NOTCONN_; } @@ -382,10 +383,22 @@ { #ifdef HTTPS_SUPPORT if (0 != (connection->daemon->options & MHD_USE_TLS)) - return MHD_send_on_connection_ (connection, - header, - header_size, - MHD_SSO_HDR_CORK); + { + ssize_t ret; + + ret = MHD_send_on_connection_ (connection, + header, + header_size, + MHD_SSO_HDR_CORK); + if ( (ret == header_size) && + (0 == buffer_size) && + connection->sk_cork_on) + { + (void) gnutls_record_uncork (connection->tls_session, 0); + connection->sk_cork_on = false; + } + return ret; + } #endif #if defined(HAVE_SENDMSG) || defined(HAVE_WRITEV) MHD_socket s = connection->socket_fd; diff -Nru libmicrohttpd-0.9.67/src/microhttpd/mhd_send.h libmicrohttpd-0.9.68/src/microhttpd/mhd_send.h --- libmicrohttpd-0.9.67/src/microhttpd/mhd_send.h 2019-10-17 14:55:53.000000000 +0000 +++ libmicrohttpd-0.9.68/src/microhttpd/mhd_send.h 2019-10-17 17:11:51.000000000 +0000 @@ -35,7 +35,9 @@ #include #include "mhd_sockets.h" #include "connection.h" +#ifdef HTTPS_SUPPORT #include "connection_https.h" +#endif #ifdef MHD_LINUX_SOLARIS_SENDFILE #include diff -Nru libmicrohttpd-0.9.67/src/microhttpd/mhd_sockets.c libmicrohttpd-0.9.68/src/microhttpd/mhd_sockets.c --- libmicrohttpd-0.9.67/src/microhttpd/mhd_sockets.c 2019-10-17 15:57:46.000000000 +0000 +++ libmicrohttpd-0.9.68/src/microhttpd/mhd_sockets.c 2019-10-17 21:10:22.000000000 +0000 @@ -530,6 +530,8 @@ return 0; /* even force flush failed!? */ return 1; /* success */ } +#else + return 1; /* success */ #endif #else /* do not have MHD_TCP_CORK_NOPUSH at all */ diff -Nru libmicrohttpd-0.9.67/src/microhttpd/response.c libmicrohttpd-0.9.68/src/microhttpd/response.c --- libmicrohttpd-0.9.67/src/microhttpd/response.c 2019-10-17 14:55:53.000000000 +0000 +++ libmicrohttpd-0.9.68/src/microhttpd/response.c 2019-10-25 21:35:10.000000000 +0000 @@ -147,8 +147,10 @@ /* NOTE: for compressed bodies, use the "Content-encoding" header */ return MHD_NO; } - if (MHD_str_equal_caseless_ (header, - MHD_HTTP_HEADER_CONTENT_LENGTH)) + if ( (0 == (MHD_RF_INSANITY_HEADER_CONTENT_LENGTH + & response->flags)) && + (MHD_str_equal_caseless_ (header, + MHD_HTTP_HEADER_CONTENT_LENGTH)) ) { /* MHD will set Content-length if allowed and possible, reject attempt by application */ @@ -838,17 +840,20 @@ return MHD_YES; } else -#else +#endif { if (0 == MHD_socket_cork_ (connection->socket_fd, true)) + { connection->sk_cork_on = true; - } -#endif - case MHD_UPGRADE_ACTION_CORK_OFF: - if (! connection->sk_cork_on) return MHD_YES; + } + return MHD_NO; + } + case MHD_UPGRADE_ACTION_CORK_OFF: + if (! connection->sk_cork_on) + return MHD_YES; #ifdef HTTPS_SUPPORT if (0 != (daemon->options & MHD_USE_TLS) ) { @@ -857,17 +862,20 @@ return MHD_YES; } else -#else +#endif { if (0 == MHD_socket_cork_ (connection->socket_fd, false)) + { connection->sk_cork_on = false; - } -#endif - default: - /* we don't understand this one */ + return MHD_YES; + } return MHD_NO; + } + default: + /* we don't understand this one */ + return MHD_NO; } } diff -Nru libmicrohttpd-0.9.67/src/testcurl/https/test_https_get.c libmicrohttpd-0.9.68/src/testcurl/https/test_https_get.c --- libmicrohttpd-0.9.67/src/testcurl/https/test_https_get.c 2019-10-17 14:55:52.000000000 +0000 +++ libmicrohttpd-0.9.68/src/testcurl/https/test_https_get.c 2019-10-26 16:47:06.000000000 +0000 @@ -37,6 +37,10 @@ extern const char srv_signed_cert_pem[]; extern const char srv_signed_key_pem[]; + +static int global_port; + + /* perform a HTTP GET request via SSL/TLS */ static int test_secure_get (FILE *test_fd, @@ -55,7 +59,8 @@ d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | MHD_USE_ERROR_LOG, port, - NULL, NULL, &http_ahc, NULL, + NULL, NULL, + &http_ahc, NULL, MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem, MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem, MHD_OPTION_END); @@ -76,13 +81,156 @@ port = (int) dinfo->port; } - ret = test_https_transfer (test_fd, port, cipher_suite, proto_version); + ret = test_https_transfer (test_fd, + port, + cipher_suite, + proto_version); MHD_stop_daemon (d); return ret; } +static int +ahc_empty (void *cls, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + size_t *upload_data_size, + void **unused) +{ + static int ptr; + struct MHD_Response *response; + int ret; + (void) cls; + (void) url; + (void) url; + (void) version; /* Unused. Silent compiler warning. */ + (void) upload_data; + (void) upload_data_size; /* Unused. Silent compiler warning. */ + + if (0 != strcasecmp ("GET", + method)) + return MHD_NO; /* unexpected method */ + if (&ptr != *unused) + { + *unused = &ptr; + return MHD_YES; + } + *unused = NULL; + response = MHD_create_response_from_buffer (0, + NULL, + MHD_RESPMEM_PERSISTENT); + ret = MHD_queue_response (connection, + MHD_HTTP_OK, + response); + MHD_destroy_response (response); + if (ret == MHD_NO) + { + fprintf (stderr, "Failed to queue response.\n"); + _exit (20); + } + return ret; +} + + +static int +curlExcessFound (CURL *c, + curl_infotype type, + char *data, + size_t size, + void *cls) +{ + static const char *excess_found = "Excess found"; + const size_t str_size = strlen (excess_found); + (void) c; /* Unused. Silence compiler warning. */ + + if ((CURLINFO_TEXT == type) + &&(size >= str_size) + &&(0 == strncmp (excess_found, data, str_size))) + *(int *) cls = 1; + return 0; +} + + +static int +testEmptyGet (int poll_flag) +{ + struct MHD_Daemon *d; + CURL *c; + char buf[2048]; + struct CBC cbc; + CURLcode errornum; + int excess_found = 0; + + + if ( (0 == global_port) && + (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) ) + { + global_port = 1225; + + } + + cbc.buf = buf; + cbc.size = 2048; + cbc.pos = 0; + d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG + | poll_flag | MHD_USE_TLS, + global_port, NULL, NULL, + &ahc_empty, NULL, + MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem, + MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem, + MHD_OPTION_END); + if (d == NULL) + return 4194304; + if (0 == global_port) + { + const union MHD_DaemonInfo *dinfo; + dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); + if ((NULL == dinfo) ||(0 == dinfo->port) ) + { + MHD_stop_daemon (d); return 32; + } + global_port = (int) dinfo->port; + } + c = curl_easy_init (); + curl_easy_setopt (c, CURLOPT_URL, "https://127.0.0.1/"); + curl_easy_setopt (c, CURLOPT_PORT, (long) global_port); + curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); + curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); + curl_easy_setopt (c, CURLOPT_DEBUGFUNCTION, &curlExcessFound); + curl_easy_setopt (c, CURLOPT_DEBUGDATA, &excess_found); + curl_easy_setopt (c, CURLOPT_VERBOSE, 1L); + curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L); + curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L); + curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 150L); + curl_easy_setopt (c, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt (c, CURLOPT_SSL_VERIFYHOST, 0L); + /* NOTE: use of CONNECTTIMEOUT without also + setting NOSIGNAL results in really weird + crashes on my system!*/ + curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1L); + if (CURLE_OK != (errornum = curl_easy_perform (c))) + { + fprintf (stderr, + "curl_easy_perform failed: `%s'\n", + curl_easy_strerror (errornum)); + curl_easy_cleanup (c); + MHD_stop_daemon (d); + return 8388608; + } + curl_easy_cleanup (c); + MHD_stop_daemon (d); + if (cbc.pos != 0) + return 16777216; + if (excess_found) + return 33554432; + return 0; +} + + int main (int argc, char *const *argv) { @@ -109,11 +257,9 @@ { aes256_sha_tlsv1 = "rsa_aes_256_sha"; } - errorCount += test_secure_get (NULL, aes256_sha_tlsv1, CURL_SSLVERSION_TLSv1); - print_test_result (errorCount, argv[0]); - + errorCount += testEmptyGet (0); curl_global_cleanup (); return errorCount != 0 ? 1 : 0; diff -Nru libmicrohttpd-0.9.67/src/testcurl/https/tls_test_common.c libmicrohttpd-0.9.68/src/testcurl/https/tls_test_common.c --- libmicrohttpd-0.9.67/src/testcurl/https/tls_test_common.c 2019-10-17 14:55:52.000000000 +0000 +++ libmicrohttpd-0.9.68/src/testcurl/https/tls_test_common.c 2019-10-26 16:42:41.000000000 +0000 @@ -62,7 +62,8 @@ */ int test_daemon_get (void *cls, - const char *cipher_suite, int proto_version, + const char *cipher_suite, + int proto_version, int port, int ver_peer) { @@ -71,7 +72,7 @@ CURLcode errornum; char url[255]; size_t len; - (void) cls; /* Unused. Silent compiler warning. */ + (void) cls; /* Unused. Silence compiler warning. */ len = strlen (test_data); if (NULL == (cbc.buf = malloc (sizeof (char) * len))) @@ -138,20 +139,29 @@ void -print_test_result (int test_outcome, char *test_name) +print_test_result (int test_outcome, + char *test_name) { if (test_outcome != 0) - fprintf (stderr, "running test: %s [fail: %u]\n", test_name, (unsigned - int) + fprintf (stderr, + "running test: %s [fail: %u]\n", + test_name, (unsigned + int) test_outcome); #if 0 else - fprintf (stdout, "running test: %s [pass]\n", test_name); + fprintf (stdout, + "running test: %s [pass]\n", + test_name); #endif } + size_t -copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) +copyBuffer (void *ptr, + size_t size, + size_t nmemb, + void *ctx) { struct CBC *cbc = ctx; @@ -162,13 +172,19 @@ return size * nmemb; } + /** * HTTP access handler call back */ int -http_ahc (void *cls, struct MHD_Connection *connection, - const char *url, const char *method, const char *version, - const char *upload_data, size_t *upload_data_size, void **ptr) +http_ahc (void *cls, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + size_t *upload_data_size, + void **ptr) { static int aptr; struct MHD_Response *response; @@ -193,15 +209,26 @@ return ret; } + /* HTTP access handler call back */ int -http_dummy_ahc (void *cls, struct MHD_Connection *connection, - const char *url, const char *method, const char *version, - const char *upload_data, size_t *upload_data_size, +http_dummy_ahc (void *cls, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + size_t *upload_data_size, void **ptr) { - (void) cls; (void) connection; (void) url; (void) method; (void) version; /* Unused. Silent compiler warning. */ - (void) upload_data; (void) upload_data_size; (void) ptr; /* Unused. Silent compiler warning. */ + (void) cls; + (void) connection; + (void) url; + (void) method; + (void) version; /* Unused. Silent compiler warning. */ + (void) upload_data; + (void) upload_data_size; + (void) ptr; /* Unused. Silent compiler warning. */ return 0; } @@ -215,7 +242,9 @@ */ /* TODO have test wrap consider a NULL cbc */ int -send_curl_req (char *url, struct CBC *cbc, const char *cipher_suite, +send_curl_req (char *url, + struct CBC *cbc, + const char *cipher_suite, int proto_version) { CURL *c; diff -Nru libmicrohttpd-0.9.67/src/testcurl/test_get.c libmicrohttpd-0.9.68/src/testcurl/test_get.c --- libmicrohttpd-0.9.67/src/testcurl/test_get.c 2019-10-17 14:55:52.000000000 +0000 +++ libmicrohttpd-0.9.68/src/testcurl/test_get.c 2019-10-26 16:34:09.000000000 +0000 @@ -719,14 +719,19 @@ const char *url, const char *method, const char *version, - const char *upload_data, size_t *upload_data_size, + const char *upload_data, + size_t *upload_data_size, void **unused) { static int ptr; struct MHD_Response *response; int ret; - (void) cls; (void) url; (void) url; (void) version; /* Unused. Silent compiler warning. */ - (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ + (void) cls; + (void) url; + (void) url; + (void) version; /* Unused. Silent compiler warning. */ + (void) upload_data; + (void) upload_data_size; /* Unused. Silent compiler warning. */ if (0 != strcasecmp ("GET", method)) return MHD_NO; /* unexpected method */ @@ -739,7 +744,9 @@ response = MHD_create_response_from_buffer (0, NULL, MHD_RESPMEM_PERSISTENT); - ret = MHD_queue_response (connection, MHD_HTTP_OK, response); + ret = MHD_queue_response (connection, + MHD_HTTP_OK, + response); MHD_destroy_response (response); if (ret == MHD_NO) { @@ -751,7 +758,10 @@ static int -curlExcessFound (CURL *c, curl_infotype type, char *data, size_t size, +curlExcessFound (CURL *c, + curl_infotype type, + char *data, + size_t size, void *cls) { static const char *excess_found = "Excess found"; diff -Nru libmicrohttpd-0.9.67/w32/common/microhttpd_dll_res_vc.rc libmicrohttpd-0.9.68/w32/common/microhttpd_dll_res_vc.rc --- libmicrohttpd-0.9.67/w32/common/microhttpd_dll_res_vc.rc 2019-10-17 15:01:43.000000000 +0000 +++ libmicrohttpd-0.9.68/w32/common/microhttpd_dll_res_vc.rc 2019-10-26 17:30:51.000000000 +0000 @@ -4,8 +4,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,67,0 - PRODUCTVERSION 0,9,67,0 + FILEVERSION 0,9,68,0 + PRODUCTVERSION 0,9,68,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #if defined(_DEBUG) FILEFLAGS VS_FF_DEBUG @@ -21,8 +21,8 @@ BLOCK "04090000" /* Lang = US English, Charset = ASCII */ BEGIN VALUE "ProductName", "GNU libmicrohttpd\0" - VALUE "ProductVersion", "0.9.67\0" - VALUE "FileVersion", "0.9.67\0" + VALUE "ProductVersion", "0.9.68\0" + VALUE "FileVersion", "0.9.68\0" VALUE "FileDescription", "GNU libmicrohttpd dll for Windows (VC build)\0" VALUE "InternalName", "libmicrohttpd\0" #if defined(_DEBUG)