aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index d854de31..746d9493 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -5729,7 +5729,7 @@ unescape_wrapper (void *cls,
5729 (void) cls; /* Mute compiler warning. */ 5729 (void) cls; /* Mute compiler warning. */
5730 5730
5731 /* TODO: add individual parameter */ 5731 /* TODO: add individual parameter */
5732 if (1 <= connection->daemon->strict_for_client) 5732 if (0 <= connection->daemon->client_discipline)
5733 return MHD_str_pct_decode_in_place_strict_ (val); 5733 return MHD_str_pct_decode_in_place_strict_ (val);
5734 5734
5735 res = MHD_str_pct_decode_in_place_lenient_ (val, &broken); 5735 res = MHD_str_pct_decode_in_place_lenient_ (val, &broken);
@@ -6653,14 +6653,33 @@ parse_options_va (struct MHD_Daemon *daemon,
6653 unsigned int); 6653 unsigned int);
6654 break; 6654 break;
6655 case MHD_OPTION_STRICT_FOR_CLIENT: 6655 case MHD_OPTION_STRICT_FOR_CLIENT:
6656 daemon->strict_for_client = va_arg (ap, int); 6656 daemon->client_discipline = va_arg (ap, int); /* Temporal assignment */
6657 /* Map to correct value */
6658 if (-1 >= daemon->client_discipline)
6659 daemon->client_discipline = -3;
6660 else if (1 <= daemon->client_discipline)
6661 daemon->client_discipline = 1;
6657#ifdef HAVE_MESSAGES 6662#ifdef HAVE_MESSAGES
6658 if ( (0 != (daemon->options & MHD_USE_PEDANTIC_CHECKS)) && 6663 if ( (0 != (daemon->options & MHD_USE_PEDANTIC_CHECKS)) &&
6659 (1 != daemon->strict_for_client) ) 6664 (1 != daemon->client_discipline) )
6660 { 6665 {
6661 MHD_DLOG (daemon, 6666 MHD_DLOG (daemon,
6662 _ ("Flag MHD_USE_PEDANTIC_CHECKS is ignored because " 6667 _ ("Flag MHD_USE_PEDANTIC_CHECKS is ignored because "
6663 "another behavior is specified by MHD_OPTION_STRICT_CLIENT.\n")); 6668 "another behaviour is specified by "
6669 "MHD_OPTION_STRICT_CLIENT.\n"));
6670 }
6671#endif /* HAVE_MESSAGES */
6672 break;
6673 case MHD_OPTION_CLIENT_DISCIPLINE_LVL:
6674 daemon->client_discipline = va_arg (ap, int);
6675#ifdef HAVE_MESSAGES
6676 if ( (0 != (daemon->options & MHD_USE_PEDANTIC_CHECKS)) &&
6677 (1 != daemon->client_discipline) )
6678 {
6679 MHD_DLOG (daemon,
6680 _ ("Flag MHD_USE_PEDANTIC_CHECKS is ignored because "
6681 "another behaviour is specified by "
6682 "MHD_OPTION_CLIENT_DISCIPLINE_LVL.\n"));
6664 } 6683 }
6665#endif /* HAVE_MESSAGES */ 6684#endif /* HAVE_MESSAGES */
6666 break; 6685 break;
@@ -6723,6 +6742,7 @@ parse_options_va (struct MHD_Daemon *daemon,
6723 break; 6742 break;
6724 /* all options taking 'int' */ 6743 /* all options taking 'int' */
6725 case MHD_OPTION_STRICT_FOR_CLIENT: 6744 case MHD_OPTION_STRICT_FOR_CLIENT:
6745 case MHD_OPTION_CLIENT_DISCIPLINE_LVL:
6726 case MHD_OPTION_SIGPIPE_HANDLED_BY_APP: 6746 case MHD_OPTION_SIGPIPE_HANDLED_BY_APP:
6727 case MHD_OPTION_TLS_NO_ALPN: 6747 case MHD_OPTION_TLS_NO_ALPN:
6728 if (MHD_NO == parse_options (daemon, 6748 if (MHD_NO == parse_options (daemon,
@@ -7102,8 +7122,8 @@ MHD_start_daemon_va (unsigned int flags,
7102 daemon->listening_address_reuse = 0; 7122 daemon->listening_address_reuse = 0;
7103 daemon->options = *pflags; 7123 daemon->options = *pflags;
7104 pflags = &daemon->options; 7124 pflags = &daemon->options;
7105 daemon->strict_for_client = (0 != (*pflags & MHD_USE_PEDANTIC_CHECKS)) ? 1 : 7125 daemon->client_discipline = (0 != (*pflags & MHD_USE_PEDANTIC_CHECKS)) ?
7106 0; 7126 1 : 0;
7107 daemon->port = port; 7127 daemon->port = port;
7108 daemon->apc = apc; 7128 daemon->apc = apc;
7109 daemon->apc_cls = apc_cls; 7129 daemon->apc_cls = apc_cls;