diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/microhttpd.h | 15 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 11 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 76847c9f..59170dfe 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -135,7 +135,7 @@ typedef intptr_t ssize_t; | |||
135 | * they are parsed as decimal numbers. | 135 | * they are parsed as decimal numbers. |
136 | * Example: 0x01093001 = 1.9.30-1. | 136 | * Example: 0x01093001 = 1.9.30-1. |
137 | */ | 137 | */ |
138 | #define MHD_VERSION 0x00097204 | 138 | #define MHD_VERSION 0x00097205 |
139 | 139 | ||
140 | /** | 140 | /** |
141 | * Operational results from MHD calls. | 141 | * Operational results from MHD calls. |
@@ -1732,7 +1732,18 @@ enum MHD_OPTION | |||
1732 | * This argument must be followed by an "unsigned int", corresponding | 1732 | * This argument must be followed by an "unsigned int", corresponding |
1733 | * to an `enum MHD_DisableSanityCheck`. | 1733 | * to an `enum MHD_DisableSanityCheck`. |
1734 | */ | 1734 | */ |
1735 | MHD_OPTION_SERVER_INSANITY = 32 | 1735 | MHD_OPTION_SERVER_INSANITY = 32, |
1736 | |||
1737 | /** | ||
1738 | * If followed by value '1' informs MHD that SIGPIPE is suppressed or | ||
1739 | * handled by application. Allows MHD to use network functions that could | ||
1740 | * generate SIGPIPE, like `sendfile()`. | ||
1741 | * Valid only for daemons without #MHD_USE_INTERNAL_POLLING_THREAD as | ||
1742 | * MHD automatically suppresses SIGPIPE for threads started by MHD. | ||
1743 | * This option should be followed by an `int` argument. | ||
1744 | * @note Available since #MHD_VERSION 0x00097205 | ||
1745 | */ | ||
1746 | MHD_OPTION_SIGPIPE_HANDLED_BY_APP = 33 | ||
1736 | }; | 1747 | }; |
1737 | 1748 | ||
1738 | 1749 | ||
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 700cbeca..0fe47228 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -5849,6 +5849,7 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
5849 | break; | 5849 | break; |
5850 | /* all options taking 'int' */ | 5850 | /* all options taking 'int' */ |
5851 | case MHD_OPTION_STRICT_FOR_CLIENT: | 5851 | case MHD_OPTION_STRICT_FOR_CLIENT: |
5852 | case MHD_OPTION_SIGPIPE_HANDLED_BY_APP: | ||
5852 | if (MHD_NO == parse_options (daemon, | 5853 | if (MHD_NO == parse_options (daemon, |
5853 | servaddr, | 5854 | servaddr, |
5854 | opt, | 5855 | opt, |
@@ -5927,6 +5928,16 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
5927 | return MHD_NO; | 5928 | return MHD_NO; |
5928 | #endif | 5929 | #endif |
5929 | #endif /* HTTPS_SUPPORT */ | 5930 | #endif /* HTTPS_SUPPORT */ |
5931 | case MHD_OPTION_SIGPIPE_HANDLED_BY_APP: | ||
5932 | if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) | ||
5933 | daemon->sigpipe_blocked = ( (va_arg (ap, | ||
5934 | int)) != 0); | ||
5935 | else | ||
5936 | { | ||
5937 | (void) va_arg (ap, | ||
5938 | int); | ||
5939 | } | ||
5940 | break; | ||
5930 | default: | 5941 | default: |
5931 | #ifdef HAVE_MESSAGES | 5942 | #ifdef HAVE_MESSAGES |
5932 | if ( ( (opt >= MHD_OPTION_HTTPS_MEM_KEY) && | 5943 | if ( ( (opt >= MHD_OPTION_HTTPS_MEM_KEY) && |