commit 7d3050325e3b77a061b40ea9ce77a360d14b4dea
parent a56b568fc9573d5e3299b6df9ad002bdf18db358
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 21 May 2017 16:11:25 +0300
MHD_suspend_connection(): prevent suspending of connections scheduled for HTTP "Upgrade"
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -2737,6 +2737,16 @@ MHD_suspend_connection (struct MHD_Connection *connection)
if (0 == (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
MHD_PANIC (_("Cannot suspend connections without enabling MHD_ALLOW_SUSPEND_RESUME!\n"));
MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
+#ifdef UPGRADE_SUPPORT
+ if (NULL != connection->urh)
+ {
+#ifdef HAVE_MESSAGES
+ MHD_DLOG (daemon,
+ _("Error: connection sheduled for \"upgrade\" cannot be suspended"));
+#endif /* HAVE_MESSAGES */
+ return;
+ }
+#endif /* UPGRADE_SUPPORT */
if (connection->resuming)
{
/* suspending again while we didn't even complete resuming yet */