diff options
Diffstat (limited to 'src/httpserver/qhttpserverfutureresponse.h')
-rw-r--r-- | src/httpserver/qhttpserverfutureresponse.h | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/httpserver/qhttpserverfutureresponse.h b/src/httpserver/qhttpserverfutureresponse.h index 45dc376..d5c8fe1 100644 --- a/src/httpserver/qhttpserverfutureresponse.h +++ b/src/httpserver/qhttpserverfutureresponse.h @@ -104,29 +104,7 @@ public: QFutureInterfaceBase::reportFinished(); } - QHttpServerResponse takeResult() - { - if (isCanceled()) { - exceptionStore().throwPossibleException(); - return QHttpServerResponse::StatusCode::NotFound; - } - - // Note: we wait for all, this is intentional, - // not to mess with other unready results. - waitForResult(-1); - -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - std::lock_guard<QMutex> locker{*mutex()}; -#else - std::lock_guard<QMutex> locker{mutex(0)}; -#endif - QtPrivate::ResultIteratorBase position = resultStoreBase().resultAt(0); - auto ret = std::move_if_noexcept( - *const_cast<QHttpServerResponse *>(position.pointer<QHttpServerResponse>())); - resultStoreBase().template clear<QHttpServerResponse>(); - - return ret; - } + QHttpServerResponse takeResult(); }; #endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0) |