diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-10-24 20:12:26 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-10-27 22:45:00 +0300 |
commit | 5b01262799b1eef4e78b0264f9715fbf7bff1857 (patch) | |
tree | c7e03ea581ae62216d19e4c40ee8d718cc668584 | |
parent | 55bc012c93d89944f8138ef0c5914c229aa13987 (diff) | |
download | libmicrohttpd-5b01262799b1eef4e78b0264f9715fbf7bff1857.tar.gz libmicrohttpd-5b01262799b1eef4e78b0264f9715fbf7bff1857.zip |
Notify application about finished HTTP connection before starting upgrade.
Unified HTTPS and HTTP modes.
-rw-r--r-- | src/microhttpd/daemon.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 09f658e0..459b82b2 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1710,14 +1710,8 @@ thread_main_handle_connection (void *data) | |||
1710 | #endif | 1710 | #endif |
1711 | if (MHD_CONNECTION_UPGRADE == con->state) | 1711 | if (MHD_CONNECTION_UPGRADE == con->state) |
1712 | { | 1712 | { |
1713 | thread_main_connection_upgrade (con); | 1713 | /* Normal HTTP processing is finished, |
1714 | #if HTTPS_SUPPORT | 1714 | * notify application. */ |
1715 | if (0 != (daemon->options & MHD_USE_TLS) ) | ||
1716 | break; | ||
1717 | #endif | ||
1718 | |||
1719 | /* skip usual clean up EXCEPT for the completion | ||
1720 | notification (which must be done in this thread)! */ | ||
1721 | if ( (NULL != daemon->notify_completed) && | 1715 | if ( (NULL != daemon->notify_completed) && |
1722 | (MHD_YES == con->client_aware) ) | 1716 | (MHD_YES == con->client_aware) ) |
1723 | daemon->notify_completed (daemon->notify_completed_cls, | 1717 | daemon->notify_completed (daemon->notify_completed_cls, |
@@ -1726,6 +1720,14 @@ thread_main_handle_connection (void *data) | |||
1726 | MHD_REQUEST_TERMINATED_COMPLETED_OK); | 1720 | MHD_REQUEST_TERMINATED_COMPLETED_OK); |
1727 | con->client_aware = MHD_NO; | 1721 | con->client_aware = MHD_NO; |
1728 | 1722 | ||
1723 | thread_main_connection_upgrade (con); | ||
1724 | #if HTTPS_SUPPORT | ||
1725 | if (0 != (daemon->options & MHD_USE_TLS) ) | ||
1726 | break; | ||
1727 | #endif | ||
1728 | |||
1729 | /* skip usual clean up EXCEPT for the completion | ||
1730 | notification (which must be done in this thread)! */ | ||
1729 | return (MHD_THRD_RTRN_TYPE_) 0; | 1731 | return (MHD_THRD_RTRN_TYPE_) 0; |
1730 | } | 1732 | } |
1731 | } | 1733 | } |