From 2606e434671bd22c622587730663828dcb6e6ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Min=C3=A1=C5=99?= Date: Thu, 15 Mar 2018 10:53:54 +0000 Subject: [PATCH 1/4] initial 4.0.2 commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Minář --- .gitignore | 2 +- sources | 2 +- ...AGE-LICENSING => wt-4.0.2-PACKAGE-LICENSING | 0 wt.spec | 18 ++++++++++-------- 4 files changed, 12 insertions(+), 10 deletions(-) rename wt-3.3.7-PACKAGE-LICENSING => wt-4.0.2-PACKAGE-LICENSING (100%) diff --git a/.gitignore b/.gitignore index eddc251..5d2347a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/wt-3.3.7-free.tar.xz +/wt-4.0.2-free.tar.xz diff --git a/sources b/sources index 97a8fca..2305083 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wt-3.3.7-free.tar.xz) = 4dcc7ac3e222a7056026004213422d571af7ed7066a50ab2bd90c432450f8da3456f45cdf0dee877d46cd11ccb03716de5b81cd2d6daa6520b07a54fa8dd1a47 +SHA512 (wt-4.0.2-free.tar.xz) = 8bd6fc043fe7316cafb484200b0f2827b64dcb1336c55f385d6e082baec4affbc31493b4a1155c8710c8ac08ccd11ad6aefa0e944679da65bcb18ffe5017c596 diff --git a/wt-3.3.7-PACKAGE-LICENSING b/wt-4.0.2-PACKAGE-LICENSING similarity index 100% rename from wt-3.3.7-PACKAGE-LICENSING rename to wt-4.0.2-PACKAGE-LICENSING diff --git a/wt.spec b/wt.spec index 1046d14..a56a526 100644 --- a/wt.spec +++ b/wt.spec @@ -5,14 +5,14 @@ %global WTRUNGROUP apache Name: wt -Version: 3.3.7 -Release: 7%{?dist} +Version: 4.0.2 +Release: 1%{?dist} Summary: C++ library for developing web applications Group: Development/Libraries # For a breakdown of the licensing, see PACKAGE-LICENSING License: GPLv2 and Boost and MIT and (Boost or MIT) and BSD and zlib -URL: http://www.webtoolkit.eu/wt +URL: https://www.webtoolkit.eu/wt # Following archive was made from upstream tarball downloaded from # https://github.com/kdeforche/wt/archive/3.3.7.tar.gz # by running ./wt-generate-tarball.sh 3.3.7 from tarball's directory @@ -152,7 +152,6 @@ cd wt-build ## by Red Hat Legal ## let's not package it, until licensing issues are solved %cmake .. \ - -DWT_CPP_11_MODE=-std=c++11 \ -DCONNECTOR_HTTP=ON \ -DCONNECTOR_FCGI=ON \ -DUSE_SYSTEM_SQLITE3=ON \ @@ -161,11 +160,12 @@ cd wt-build -DWEBGROUP="%{WTRUNGROUP}" \ -DRUNDIR="%{WTRUNDIR}" \ -DCONFIGDIR="%{_sysconfdir}/%{name}" \ - -DINSTALL_EXAMPLES=ON \ -DENABLE_FIREBIRD=OFF \ -DENABLE_MYSQL=ON \ -DMYSQL_LIBRARY=mysqlclient \ %{?use_system_glew:-DUSE_SYSTEM_GLEW=1} \ + -DBUILD_EXAMPLES=ON \ + -DINSTALL_EXAMPLES=ON \ -DEXAMPLES_DESTINATION=%{_lib}/Wt/examples make %{?_smp_mflags} make doc @@ -195,8 +195,6 @@ do # create a symlink for each feature example pointing on resources dir done popd # examples popd # wt-build -install -vm 0755 -d ${RPM_BUILD_ROOT}/%{_datadir}/cmake/Modules -install -vm 0644 cmake/FindWt.cmake ${RPM_BUILD_ROOT}/%{_datadir}/cmake/Modules install -vm 644 %{SOURCE2} \ ${RPM_BUILD_ROOT}%{_libdir}/Wt/examples/feature/timezone/README.fedora @@ -274,7 +272,8 @@ popd %dir %{_includedir}/Wt %{_includedir}/Wt/* %{_libdir}/*.so -%{_datadir}/cmake/Modules/*.cmake +%dir %{_libdir}/cmake/wt +%{_libdir}/cmake/wt/*.cmake %files examples %dir %{_libdir}/Wt @@ -296,6 +295,9 @@ popd %{_defaultdocdir}/%{name}-doc/examples/* %changelog +* Thu Mar 15 2018 Michal Minář - 4.0.2-1 +- New upstream version 4.0.2 + * Fri Feb 09 2018 Fedora Release Engineering - 3.3.7-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From a740b06c0f4760ead486aff55d14262818a5aaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Min=C3=A1=C5=99?= Date: Thu, 15 Mar 2018 13:33:30 +0000 Subject: [PATCH 2/4] boost 1.66 compatibility fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: bz#1556597 Resolves: bz#1540337 Resolves: bz#1467752 Signed-off-by: Michal Minář --- boost-166-compat.patch | 605 +++++++++++++++++++++++++++++++++++++++++ examples-crypt.patch | 24 ++ wt.spec | 13 +- 3 files changed, 638 insertions(+), 4 deletions(-) create mode 100644 boost-166-compat.patch create mode 100644 examples-crypt.patch diff --git a/boost-166-compat.patch b/boost-166-compat.patch new file mode 100644 index 0000000..db09374 --- /dev/null +++ b/boost-166-compat.patch @@ -0,0 +1,605 @@ +Index: wt-4.0.2/examples/filetreetable/CMakeLists.txt +=================================================================== +--- wt-4.0.2.orig/examples/filetreetable/CMakeLists.txt ++++ wt-4.0.2/examples/filetreetable/CMakeLists.txt +@@ -10,6 +10,7 @@ ELSE(NOT BOOST_FS_LIB) + + TARGET_LINK_LIBRARIES(filetreetable.wt + ${BOOST_FS_LIB} ++ ${BOOST_SYSTEM_LIB} + ) + + INCLUDE_DIRECTORIES(${WT_SOURCE_DIR}/src) +Index: wt-4.0.2/examples/gitmodel/CMakeLists.txt +=================================================================== +--- wt-4.0.2.orig/examples/gitmodel/CMakeLists.txt ++++ wt-4.0.2/examples/gitmodel/CMakeLists.txt +@@ -7,7 +7,7 @@ IF(BOOST_FS_LIB) + ../wt-homepage/SourceView.C + GitView.C + ) +- TARGET_LINK_LIBRARIES(gitview.wt ${BOOST_FS_LIB}) ++ TARGET_LINK_LIBRARIES(gitview.wt ${BOOST_FS_LIB} ${BOOST_SYSTEM_LIB}) + + INCLUDE_DIRECTORIES( + ${WT_SOURCE_DIR}/src +Index: wt-4.0.2/examples/wt-homepage/CMakeLists.txt +=================================================================== +--- wt-4.0.2.orig/examples/wt-homepage/CMakeLists.txt ++++ wt-4.0.2/examples/wt-homepage/CMakeLists.txt +@@ -34,7 +34,7 @@ ENDIF(WT_EMWEB_BUILD) + + WT_ADD_EXAMPLE(Home.wt ${SRC}) + +-TARGET_LINK_LIBRARIES(Home.wt ${EXAMPLES_DBO_LIBS} ${BOOST_FS_LIB}) ++TARGET_LINK_LIBRARIES(Home.wt ${EXAMPLES_DBO_LIBS} ${BOOST_FS_LIB} ${BOOST_SYSTEM_LIB}) + + # Test whether crypt(3) is provided by libc. If it's not, check if + # libcrypt exists and if it provides crypt(3). +Index: wt-4.0.2/src/Wt/AsioWrapper/strand.hpp +=================================================================== +--- wt-4.0.2.orig/src/Wt/AsioWrapper/strand.hpp ++++ wt-4.0.2/src/Wt/AsioWrapper/strand.hpp +@@ -12,10 +12,29 @@ + #ifdef WT_ASIO_IS_BOOST_ASIO + + #include ++namespace Wt { ++ namespace AsioWrapper { ++#if BOOST_VERSION >= 106600 ++ using strand = boost::asio::io_context::strand; ++#else ++ using strand = boost::asio::strand; ++#endif ++ } ++} + + #else // WT_ASIO_IS_STANDALONE_ASIO + ++#include + #include ++namespace Wt { ++ namespace AsioWrapper { ++#if ASIO_VERSION >= 101100 ++ using strand = asio::io_service::strand; ++#else ++ using strand = asio::strand; ++#endif ++ } ++} + + #endif // WT_ASIO_IS_BOOST_ASIO + +Index: wt-4.0.2/src/Wt/Http/Client.C +=================================================================== +--- wt-4.0.2.orig/src/Wt/Http/Client.C ++++ wt-4.0.2/src/Wt/Http/Client.C +@@ -642,7 +642,7 @@ private: + + protected: + asio::io_service& ioService_; +- asio::strand strand_; ++ AsioWrapper::strand strand_; + tcp::resolver resolver_; + asio::streambuf requestBuf_; + asio::streambuf responseBuf_; +@@ -929,8 +929,14 @@ bool Client::request(Http::Method method + + #ifdef WT_WITH_SSL + } else if (parsedUrl.protocol == "https") { ++#if defined(WT_ASIO_IS_BOOST_ASIO) && BOOST_VERSION >= 106600 ++ asio::ssl::context context(asio::ssl::context::tls); ++#elif defined(WT_ASIO_IS_STANDALONE_ASIO) && ASIO_VERSION >= 101100 ++ asio::ssl::context context(asio::ssl::context::sslv23); ++#else + asio::ssl::context context + (*ioService, asio::ssl::context::sslv23); ++#endif + long sslOptions = asio::ssl::context::no_sslv2 | asio::ssl::context::no_sslv3; + context.set_options(sslOptions); + +Index: wt-4.0.2/src/Wt/Http/Client.h +=================================================================== +--- wt-4.0.2.orig/src/Wt/Http/Client.h ++++ wt-4.0.2/src/Wt/Http/Client.h +@@ -23,7 +23,12 @@ + #ifdef WT_ASIO_IS_BOOST_ASIO + namespace boost { + namespace asio { ++#if BOOST_VERSION >= 106600 ++ class io_context; ++ typedef io_context io_service; ++#else + class io_service; ++#endif + } + } + #else // WT_ASIO_IS_STANDALONE_ASIO +Index: wt-4.0.2/src/Wt/Json/Value.h +=================================================================== +--- wt-4.0.2.orig/src/Wt/Json/Value.h ++++ wt-4.0.2/src/Wt/Json/Value.h +@@ -23,7 +23,7 @@ class Array; + * \brief A JSON representation and parsing library. + * + * The JSON library contains data types to represent a JSON data +- * structure (Value, Object and Array), and a JSON parser. ++ * structure (Value, Object and Array), a JSON parser, and a JSON serializer. + * + * Usage example: + * \code +@@ -39,6 +39,9 @@ class Array; + * bool b = result.get("b"); + * std::cerr << "a: " << s << ", b: " << b << std::endl; // a: That's great, b: true + * \endcode ++ * ++ * Include the header for Wt::Json::parse(), and ++ * the header for Wt::Json::serialize(). + */ + + /*! \brief Enumeration for the type of a JSON value. +Index: wt-4.0.2/src/Wt/WDialog.C +=================================================================== +--- wt-4.0.2.orig/src/Wt/WDialog.C ++++ wt-4.0.2/src/Wt/WDialog.C +@@ -436,8 +436,10 @@ void WDialog::render(WFlags + if (!isModal()) + impl_->mouseWentDown().connect(this, &WDialog::bringToFront); + +- if ( flags.test(RenderFlag::Full) && autoFocus_) +- impl_->setFirstFocus(); ++ if ( flags.test(RenderFlag::Full) && autoFocus_) { ++ if (!impl_->findById(Wt::WApplication::instance()->focus())) ++ impl_->setFirstFocus(); ++ } + + WPopupWidget::render(flags); + } +Index: wt-4.0.2/src/Wt/WDialog.h +=================================================================== +--- wt-4.0.2.orig/src/Wt/WDialog.h ++++ wt-4.0.2/src/Wt/WDialog.h +@@ -337,6 +337,9 @@ public: + bool closable() const { return closeIcon_ != nullptr; } + + /*! \brief Set focus on the first widget in the dialog. ++ * ++ * Autofocus is enabled by default. If a widget inside of ++ * this dialog already has focus, the focus will not be changed. + */ + void setAutoFocus(bool enable){ autoFocus_ = enable;} + +Index: wt-4.0.2/src/Wt/WWebWidget.C +=================================================================== +--- wt-4.0.2.orig/src/Wt/WWebWidget.C ++++ wt-4.0.2/src/Wt/WWebWidget.C +@@ -1983,9 +1983,13 @@ bool WWebWidget::setFirstFocus() + return true; + } + +- for (unsigned i = 0; i < children().size(); i++) +- if (children()[i]->setFirstFocus()) +- return true; ++ bool result = false; ++ iterateChildren([&result](Wt::WWidget *w){ ++ if (!result) ++ result = w->setFirstFocus(); ++ }); ++ if (result) ++ return true; + + return false; + } else +@@ -2207,6 +2211,8 @@ WWidget *WWebWidget::findById(const std: + if (!result) + result = c->findById(id); + }); ++ if (result) ++ return result; + } + + return nullptr; +Index: wt-4.0.2/src/http/Connection.C +=================================================================== +--- wt-4.0.2.orig/src/http/Connection.C ++++ wt-4.0.2/src/http/Connection.C +@@ -61,6 +61,15 @@ Connection::~Connection() + LOG_DEBUG("~Connection"); + } + ++asio::ip::tcp::socket::native_handle_type Connection::native() ++{ ++#if (defined(WT_ASIO_IS_BOOST_ASIO) && BOOST_VERSION >= 106600) || (defined(WT_ASIO_IS_STANDALONE_ASIO) && ASIO_VERSION >= 101100) ++ return socket().native_handle(); ++#else ++ return socket().native(); ++#endif ++} ++ + void Connection::finishReply() + { + if (!request_.uri.empty()) { +@@ -78,7 +87,7 @@ void Connection::scheduleStop() + + void Connection::start() + { +- LOG_DEBUG(socket().native() << ": start()"); ++ LOG_DEBUG(native() << ": start()"); + + request_parser_.reset(); + request_.reset(); +@@ -106,7 +115,7 @@ void Connection::stop() + void Connection::setReadTimeout(int seconds) + { + if (seconds != 0) { +- LOG_DEBUG(socket().native() << " setting read timeout (ws: " ++ LOG_DEBUG(native() << " setting read timeout (ws: " + << request_.webSocketVersion << ")"); + state_ |= Reading; + +@@ -118,7 +127,7 @@ void Connection::setReadTimeout(int seco + + void Connection::setWriteTimeout(int seconds) + { +- LOG_DEBUG(socket().native() << " setting write timeout (ws: " ++ LOG_DEBUG(native() << " setting write timeout (ws: " + << request_.webSocketVersion << ")"); + state_ |= Writing; + +@@ -129,7 +138,7 @@ void Connection::setWriteTimeout(int sec + + void Connection::cancelReadTimer() + { +- LOG_DEBUG(socket().native() << " cancel read timeout"); ++ LOG_DEBUG(native() << " cancel read timeout"); + state_.clear(Reading); + + readTimer_.cancel(); +@@ -137,7 +146,7 @@ void Connection::cancelReadTimer() + + void Connection::cancelWriteTimer() + { +- LOG_DEBUG(socket().native() << " cancel write timeout"); ++ LOG_DEBUG(native() << " cancel write timeout"); + state_.clear(Writing); + + writeTimer_.cancel(); +@@ -163,7 +172,7 @@ void Connection::handleReadRequest0() + + #ifdef DEBUG + try { +- LOG_DEBUG(socket().native() << "incoming request: " ++ LOG_DEBUG(socket().native_handle() << "incoming request: " + << socket().remote_endpoint().port() << " (avail= " + << (rcv_buffer_size_ - (rcv_remaining_ - buffer.data())) << "): " + << std::string(rcv_remaining_, +@@ -189,7 +198,7 @@ void Connection::handleReadRequest0() + if (doWebSockets) + request_.enableWebSocket(); + +- LOG_DEBUG(socket().native() << "request: " << status); ++ LOG_DEBUG(native() << "request: " << status); + + if (status >= 300) + sendStockReply(status); +@@ -242,7 +251,7 @@ void Connection::sendStockReply(StockRep + void Connection::handleReadRequest(const Wt::AsioWrapper::error_code& e, + std::size_t bytes_transferred) + { +- LOG_DEBUG(socket().native() << ": handleReadRequest(): " << e.message()); ++ LOG_DEBUG(native() << ": handleReadRequest(): " << e.message()); + + cancelReadTimer(); + +@@ -261,7 +270,7 @@ void Connection::close() + cancelReadTimer(); + cancelWriteTimer(); + +- LOG_DEBUG(socket().native() << ": close()"); ++ LOG_DEBUG(native() << ": close()"); + + ConnectionManager_.stop(shared_from_this()); + } +@@ -274,7 +283,7 @@ bool Connection::closed() const + + void Connection::handleError(const Wt::AsioWrapper::error_code& e) + { +- LOG_DEBUG(socket().native() << ": error: " << e.message()); ++ LOG_DEBUG(native() << ": error: " << e.message()); + + close(); + } +@@ -349,7 +358,7 @@ void Connection::handleReadBody0(ReplyPt + const Wt::AsioWrapper::error_code& e, + std::size_t bytes_transferred) + { +- LOG_DEBUG(socket().native() << ": handleReadBody0(): " << e.message()); ++ LOG_DEBUG(native() << ": handleReadBody0(): " << e.message()); + + if (disconnectCallback_) { + if (e && e != asio::error::operation_aborted) { +@@ -357,7 +366,7 @@ void Connection::handleReadBody0(ReplyPt + disconnectCallback_ = boost::function(); + f(); + } else if (!e) { +- LOG_ERROR(socket().native() ++ LOG_ERROR(native() + << ": handleReadBody(): while waiting for disconnect, " + "received unexpected data, closing"); + close(); +@@ -410,7 +419,7 @@ void Connection::startWriteResponse(Repl + } + #endif + +- LOG_DEBUG(socket().native() << " sending: " << s << "(buffers: " ++ LOG_DEBUG(native() << " sending: " << s << "(buffers: " + << buffers.size() << ")"); + + if (!buffers.empty()) { +@@ -423,7 +432,7 @@ void Connection::startWriteResponse(Repl + + void Connection::handleWriteResponse(ReplyPtr reply) + { +- LOG_DEBUG(socket().native() << ": handleWriteResponse() " << ++ LOG_DEBUG(native() << ": handleWriteResponse() " << + haveResponse_ << " " << responseDone_); + if (haveResponse_) + startWriteResponse(reply); +@@ -458,7 +467,7 @@ void Connection::handleWriteResponse0(Re + const Wt::AsioWrapper::error_code& e, + std::size_t bytes_transferred) + { +- LOG_DEBUG(socket().native() << ": handleWriteResponse0(): " ++ LOG_DEBUG(native() << ": handleWriteResponse0(): " + << bytes_transferred << " ; " << e.message()); + + cancelWriteTimer(); +Index: wt-4.0.2/src/http/Connection.h +=================================================================== +--- wt-4.0.2.orig/src/http/Connection.h ++++ wt-4.0.2/src/http/Connection.h +@@ -18,6 +18,7 @@ + #define HTTP_CONNECTION_HPP + + #include ++#include + #include + + #include "Buffer.h" +@@ -61,7 +62,7 @@ public: + virtual ~Connection(); + + Server *server() const { return server_; } +- asio::strand& strand() { return strand_; } ++ Wt::AsioWrapper::strand& strand() { return strand_; } + + /// Stop all asynchronous operations associated with the connection. + void scheduleStop(); +@@ -86,6 +87,9 @@ public: + const std::function& callback); + + protected: ++ /// Get the native handle of the socket ++ asio::ip::tcp::socket::native_handle_type native(); ++ + void handleWriteResponse0(ReplyPtr reply, + const Wt::AsioWrapper::error_code& e, + std::size_t bytes_transferred); +@@ -104,7 +108,7 @@ protected: + /// The manager for this connection. + ConnectionManager& ConnectionManager_; + +- asio::strand strand_; ++ Wt::AsioWrapper::strand strand_; + + void finishReply(); + +Index: wt-4.0.2/src/http/Reply.C +=================================================================== +--- wt-4.0.2.orig/src/http/Reply.C ++++ wt-4.0.2/src/http/Reply.C +@@ -596,7 +596,8 @@ bool Reply::encodeNextContentBuffer( + originalSize += bs; + + gzipStrm_.avail_in = bs; +- gzipStrm_.next_in = (unsigned char *)asio::detail::buffer_cast_helper(b); ++ gzipStrm_.next_in = const_cast( ++ asio::buffer_cast(b)); + + unsigned char out[16*1024]; + do { +Index: wt-4.0.2/src/http/Server.C +=================================================================== +--- wt-4.0.2.orig/src/http/Server.C ++++ wt-4.0.2/src/http/Server.C +@@ -116,7 +116,11 @@ Server::Server(const Configuration& conf + accept_strand_(wt_.ioService()), + // post_strand_(ioService_), + #ifdef HTTP_WITH_SSL ++#if (defined(WT_ASIO_IS_BOOST_ASIO) && BOOST_VERSION >= 106600) || (defined(WT_ASIO_IS_STANDALONE_ASIO) && ASIO_VERSION >= 101100) ++ ssl_context_(asio::ssl::context::sslv23), ++#else + ssl_context_(wt_.ioService(), asio::ssl::context::sslv23), ++#endif + #endif // HTTP_WITH_SSL + connection_manager_(), + sessionManager_(0), +Index: wt-4.0.2/src/http/Server.h +=================================================================== +--- wt-4.0.2.orig/src/http/Server.h ++++ wt-4.0.2/src/http/Server.h +@@ -129,7 +129,7 @@ private: + Wt::WLogger accessLogger_; + + /// The strand for handleTcpAccept(), handleSslAccept() and handleStop() +- asio::strand accept_strand_; ++ Wt::AsioWrapper::strand accept_strand_; + + /// Acceptors used to listen for incoming http connections. + std::vector tcp_listeners_; +Index: wt-4.0.2/src/http/SessionProcess.C +=================================================================== +--- wt-4.0.2.orig/src/http/SessionProcess.C ++++ wt-4.0.2/src/http/SessionProcess.C +@@ -16,6 +16,7 @@ + #include + #endif // WT_WIN32 + ++#include "Wt/WConfig.h" + #include "Wt/WLogger.h" + + namespace Wt { +@@ -80,7 +81,11 @@ void SessionProcess::asyncExec(const Con + if (!ec) + acceptor_->listen(0, ec); + #ifndef WT_WIN32 ++#if (defined(WT_ASIO_IS_BOOST_ASIO) && BOOST_VERSION >= 106600) || (defined(WT_ASIO_IS_STANDALONE_ASIO) && ASIO_VERSION >= 101100) ++ fcntl(acceptor_->native_handle(), F_SETFD, FD_CLOEXEC); ++#else + fcntl(acceptor_->native(), F_SETFD, FD_CLOEXEC); ++#endif + #endif // !WT_WIN32 + if (ec) { + LOG_ERROR("Couldn't create listening socket: " << ec.message()); +Index: wt-4.0.2/src/http/SslConnection.C +=================================================================== +--- wt-4.0.2.orig/src/http/SslConnection.C ++++ wt-4.0.2/src/http/SslConnection.C +@@ -81,9 +81,9 @@ void SslConnection::handleHandshake(cons + + void SslConnection::stop() + { +- LOG_DEBUG(socket().native() << ": stop()"); ++ LOG_DEBUG(native() << ": stop()"); + finishReply(); +- LOG_DEBUG(socket().native() << ": SSL shutdown"); ++ LOG_DEBUG(native() << ": SSL shutdown"); + + Connection::stop(); + +@@ -108,20 +108,20 @@ void SslConnection::stopNextLayer(const + // In case of timeout, we will get here twice. + sslShutdownTimer_.cancel(); + if (ec) { +- LOG_DEBUG(socket().native() << ": ssl_shutdown failed:" ++ LOG_DEBUG(native() << ": ssl_shutdown failed:" + << ec.message()); + } + try { + if (socket().is_open()) { + Wt::AsioWrapper::error_code ignored_ec; +- LOG_DEBUG(socket().native() << ": socket shutdown"); ++ LOG_DEBUG(native() << ": socket shutdown"); + socket().shutdown(asio::ip::tcp::socket::shutdown_both, + ignored_ec); +- LOG_DEBUG(socket().native() << "closing socket"); ++ LOG_DEBUG(native() << "closing socket"); + socket().close(); + } + } catch (Wt::AsioWrapper::system_error& e) { +- LOG_DEBUG(socket().native() << ": error " << e.what()); ++ LOG_DEBUG(native() << ": error " << e.what()); + } + } + +@@ -161,7 +161,7 @@ void SslConnection::startAsyncReadBody(R + Buffer& buffer, int timeout) + { + if (state_ & Reading) { +- LOG_DEBUG(socket().native() << ": state_ = " ++ LOG_DEBUG(native() << ": state_ = " + << (state_ & Reading ? "reading " : "") + << (state_ & Writing ? "writing " : "")); + stop(); +@@ -198,7 +198,7 @@ void SslConnection + int timeout) + { + if (state_ & Writing) { +- LOG_DEBUG(socket().native() << ": state_ = " ++ LOG_DEBUG(native() << ": state_ = " + << (state_ & Reading ? "reading " : "") + << (state_ & Writing ? "writing " : "")); + stop(); +Index: wt-4.0.2/src/http/TcpConnection.C +=================================================================== +--- wt-4.0.2.orig/src/http/TcpConnection.C ++++ wt-4.0.2/src/http/TcpConnection.C +@@ -38,17 +38,17 @@ asio::ip::tcp::socket& TcpConnection::so + + void TcpConnection::stop() + { +- LOG_DEBUG(socket().native() << ": stop()"); ++ LOG_DEBUG(native() << ": stop()"); + + finishReply(); + + try { + Wt::AsioWrapper::error_code ignored_ec; + socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec); +- LOG_DEBUG(socket().native() << ": closing socket"); ++ LOG_DEBUG(native() << ": closing socket"); + socket_.close(); + } catch (Wt::AsioWrapper::system_error& e) { +- LOG_DEBUG(socket().native() << ": error " << e.what()); ++ LOG_DEBUG(native() << ": error " << e.what()); + } + + Connection::stop(); +@@ -56,10 +56,10 @@ void TcpConnection::stop() + + void TcpConnection::startAsyncReadRequest(Buffer& buffer, int timeout) + { +- LOG_DEBUG(socket().native() << ": startAsyncReadRequest"); ++ LOG_DEBUG(native() << ": startAsyncReadRequest"); + + if (state_ & Reading) { +- LOG_DEBUG(socket().native() << ": state_ = " ++ LOG_DEBUG(native() << ": state_ = " + << (state_ & Reading ? "reading " : "") + << (state_ & Writing ? "writing " : "")); + stop(); +@@ -81,10 +81,10 @@ void TcpConnection::startAsyncReadReques + void TcpConnection::startAsyncReadBody(ReplyPtr reply, + Buffer& buffer, int timeout) + { +- LOG_DEBUG(socket().native() << ": startAsyncReadBody"); ++ LOG_DEBUG(native() << ": startAsyncReadBody"); + + if (state_ & Reading) { +- LOG_DEBUG(socket().native() << ": state_ = " ++ LOG_DEBUG(native() << ": state_ = " + << (state_ & Reading ? "reading " : "") + << (state_ & Writing ? "writing " : "")); + stop(); +@@ -109,10 +109,10 @@ void TcpConnection::startAsyncWriteRespo + const std::vector& buffers, + int timeout) + { +- LOG_DEBUG(socket().native() << ": startAsyncWriteResponse"); ++ LOG_DEBUG(native() << ": startAsyncWriteResponse"); + + if (state_ & Writing) { +- LOG_DEBUG(socket().native() << ": state_ = " ++ LOG_DEBUG(native() << ": state_ = " + << (state_ & Reading ? "reading " : "") + << (state_ & Writing ? "writing " : "")); + stop(); +Index: wt-4.0.2/src/web/Configuration.C +=================================================================== +--- wt-4.0.2.orig/src/web/Configuration.C ++++ wt-4.0.2/src/web/Configuration.C +@@ -825,14 +825,10 @@ void Configuration::readApplicationSetti + runDirectory_ = singleChildElementValue(fcgi, "run-directory", + runDirectory_); + +- setInt(fcgi, "num-threads", numThreads_); // backward compatibility < 3.2.0 +- + xml_node<> *isapi = singleChildElement(app, "connector-isapi"); + if (!isapi) + isapi = app; // backward compatibility + +- setInt(isapi, "num-threads", numThreads_); // backward compatibility < 3.2.0 +- + std::string maxMemoryRequestSizeStr = + singleChildElementValue(isapi, "max-memory-request-size", ""); + if (!maxMemoryRequestSizeStr.empty()) { diff --git a/examples-crypt.patch b/examples-crypt.patch new file mode 100644 index 0000000..dea05a2 --- /dev/null +++ b/examples-crypt.patch @@ -0,0 +1,24 @@ +Index: wt-4.0.2/examples/blog/model/BlogSession.C +=================================================================== +--- wt-4.0.2.orig/examples/blog/model/BlogSession.C ++++ wt-4.0.2/examples/blog/model/BlogSession.C +@@ -28,6 +28,7 @@ + + #if !defined(WT_WIN32) && !defined(__CYGWIN__) && !defined(ANDROID) + #define HAVE_CRYPT ++#include + #endif + + namespace { +Index: wt-4.0.2/examples/hangman/Session.C +=================================================================== +--- wt-4.0.2.orig/examples/hangman/Session.C ++++ wt-4.0.2/examples/hangman/Session.C +@@ -24,6 +24,7 @@ + + #if !defined(WT_WIN32) && !defined(__CYGWIN__) && !defined(ANDROID) + #define HAVE_CRYPT ++#include + #endif + + namespace dbo = Wt::Dbo; diff --git a/wt.spec b/wt.spec index a56a526..ad3ba7b 100644 --- a/wt.spec +++ b/wt.spec @@ -6,7 +6,7 @@ Name: wt Version: 4.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: C++ library for developing web applications Group: Development/Libraries @@ -31,6 +31,10 @@ Source4: wt-generate-tarball.sh Patch0: find-mysql.patch Patch1: use-system-sqlite.patch +# taken from https://github.com/emweb/wt/commit/960e8d017b264710e344c63f9feb6ea1fa593eeb.patch +# author of the patch: Roel Standaert +Patch2: boost-166-compat.patch +Patch3: examples-crypt.patch BuildRequires: cmake >= 2.6 boost-devel >= 1.41 gcc-c++ openssl-devel doxygen BuildRequires: GraphicsMagick-devel pango-devel sqlite-devel postgresql-devel @@ -111,9 +115,7 @@ Group: Documentation This package contains the documents for Wt API and examples. %prep -%setup -q -n %{name}-%{version} -%patch0 -p1 -b .find-mysql -%patch1 -p1 -b .use-system-sqlite +%autosetup -p1 # static files like javascript and css should not be executable for d in src resources examples; do @@ -295,6 +297,9 @@ popd %{_defaultdocdir}/%{name}-doc/examples/* %changelog +* Thu Mar 15 2018 Michal Minář - 4.0.2-2 +- Compatibility fix for boost 1.66 + * Thu Mar 15 2018 Michal Minář - 4.0.2-1 - New upstream version 4.0.2 From d44a508f729a7824b3972e8cbecaccc75c4a5209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Min=C3=A1=C5=99?= Date: Thu, 15 Mar 2018 15:50:48 +0000 Subject: [PATCH 3/4] Depend on mariadb-connector-c-devel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: bz#1493662 Signed-off-by: Michal Minář --- wt.spec | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/wt.spec b/wt.spec index ad3ba7b..b39420f 100644 --- a/wt.spec +++ b/wt.spec @@ -6,7 +6,7 @@ Name: wt Version: 4.0.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: C++ library for developing web applications Group: Development/Libraries @@ -29,16 +29,15 @@ Source3: README.fedora # ./wt-generate-tarball.sh UPSTREAM_VERSION Source4: wt-generate-tarball.sh -Patch0: find-mysql.patch -Patch1: use-system-sqlite.patch +Patch0: use-system-sqlite.patch # taken from https://github.com/emweb/wt/commit/960e8d017b264710e344c63f9feb6ea1fa593eeb.patch # author of the patch: Roel Standaert -Patch2: boost-166-compat.patch -Patch3: examples-crypt.patch +Patch1: boost-166-compat.patch +Patch2: examples-crypt.patch -BuildRequires: cmake >= 2.6 boost-devel >= 1.41 gcc-c++ openssl-devel doxygen +BuildRequires: cmake >= 3.1 boost-devel >= 1.41 gcc-c++ openssl-devel doxygen BuildRequires: GraphicsMagick-devel pango-devel sqlite-devel postgresql-devel -BuildRequires: mysql-devel libharu-devel fcgi-devel zlib-devel qt-devel +BuildRequires: mariadb-connector-c-devel libharu-devel fcgi-devel zlib-devel qt-devel # Don't use bundled glew on fedora >= 21 %if 0%{?fedora} >= 21 @@ -164,7 +163,6 @@ cd wt-build -DCONFIGDIR="%{_sysconfdir}/%{name}" \ -DENABLE_FIREBIRD=OFF \ -DENABLE_MYSQL=ON \ - -DMYSQL_LIBRARY=mysqlclient \ %{?use_system_glew:-DUSE_SYSTEM_GLEW=1} \ -DBUILD_EXAMPLES=ON \ -DINSTALL_EXAMPLES=ON \ @@ -297,11 +295,10 @@ popd %{_defaultdocdir}/%{name}-doc/examples/* %changelog -* Thu Mar 15 2018 Michal Minář - 4.0.2-2 -- Compatibility fix for boost 1.66 - -* Thu Mar 15 2018 Michal Minář - 4.0.2-1 +* Thu Mar 15 2018 Michal Minář - 4.0.2-3 - New upstream version 4.0.2 +- Compatibility fix for boost 1.66 +- Depend on mariadb-connector-c-devel * Fri Feb 09 2018 Fedora Release Engineering - 3.3.7-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 96350c76b173d3fafc5cbf8e100ee17d4dd350ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Min=C3=A1=C5=99?= Date: Mon, 23 Jul 2018 10:15:36 +0000 Subject: [PATCH 4/4] New upstream version 4.0.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NVR: wt-4.0.3-1 Signed-off-by: Michal Minář --- .gitignore | 2 +- boost-166-compat.patch | 605 ------------------ examples-crypt.patch | 24 - sources | 2 +- ...GE-LICENSING => wt-4.0.3-PACKAGE-LICENSING | 0 wt.spec | 11 +- 6 files changed, 7 insertions(+), 637 deletions(-) delete mode 100644 boost-166-compat.patch delete mode 100644 examples-crypt.patch rename wt-4.0.2-PACKAGE-LICENSING => wt-4.0.3-PACKAGE-LICENSING (100%) diff --git a/.gitignore b/.gitignore index 5d2347a..5a1c3e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/wt-4.0.2-free.tar.xz +/wt-4.0.3-free.tar.xz diff --git a/boost-166-compat.patch b/boost-166-compat.patch deleted file mode 100644 index db09374..0000000 --- a/boost-166-compat.patch +++ /dev/null @@ -1,605 +0,0 @@ -Index: wt-4.0.2/examples/filetreetable/CMakeLists.txt -=================================================================== ---- wt-4.0.2.orig/examples/filetreetable/CMakeLists.txt -+++ wt-4.0.2/examples/filetreetable/CMakeLists.txt -@@ -10,6 +10,7 @@ ELSE(NOT BOOST_FS_LIB) - - TARGET_LINK_LIBRARIES(filetreetable.wt - ${BOOST_FS_LIB} -+ ${BOOST_SYSTEM_LIB} - ) - - INCLUDE_DIRECTORIES(${WT_SOURCE_DIR}/src) -Index: wt-4.0.2/examples/gitmodel/CMakeLists.txt -=================================================================== ---- wt-4.0.2.orig/examples/gitmodel/CMakeLists.txt -+++ wt-4.0.2/examples/gitmodel/CMakeLists.txt -@@ -7,7 +7,7 @@ IF(BOOST_FS_LIB) - ../wt-homepage/SourceView.C - GitView.C - ) -- TARGET_LINK_LIBRARIES(gitview.wt ${BOOST_FS_LIB}) -+ TARGET_LINK_LIBRARIES(gitview.wt ${BOOST_FS_LIB} ${BOOST_SYSTEM_LIB}) - - INCLUDE_DIRECTORIES( - ${WT_SOURCE_DIR}/src -Index: wt-4.0.2/examples/wt-homepage/CMakeLists.txt -=================================================================== ---- wt-4.0.2.orig/examples/wt-homepage/CMakeLists.txt -+++ wt-4.0.2/examples/wt-homepage/CMakeLists.txt -@@ -34,7 +34,7 @@ ENDIF(WT_EMWEB_BUILD) - - WT_ADD_EXAMPLE(Home.wt ${SRC}) - --TARGET_LINK_LIBRARIES(Home.wt ${EXAMPLES_DBO_LIBS} ${BOOST_FS_LIB}) -+TARGET_LINK_LIBRARIES(Home.wt ${EXAMPLES_DBO_LIBS} ${BOOST_FS_LIB} ${BOOST_SYSTEM_LIB}) - - # Test whether crypt(3) is provided by libc. If it's not, check if - # libcrypt exists and if it provides crypt(3). -Index: wt-4.0.2/src/Wt/AsioWrapper/strand.hpp -=================================================================== ---- wt-4.0.2.orig/src/Wt/AsioWrapper/strand.hpp -+++ wt-4.0.2/src/Wt/AsioWrapper/strand.hpp -@@ -12,10 +12,29 @@ - #ifdef WT_ASIO_IS_BOOST_ASIO - - #include -+namespace Wt { -+ namespace AsioWrapper { -+#if BOOST_VERSION >= 106600 -+ using strand = boost::asio::io_context::strand; -+#else -+ using strand = boost::asio::strand; -+#endif -+ } -+} - - #else // WT_ASIO_IS_STANDALONE_ASIO - -+#include - #include -+namespace Wt { -+ namespace AsioWrapper { -+#if ASIO_VERSION >= 101100 -+ using strand = asio::io_service::strand; -+#else -+ using strand = asio::strand; -+#endif -+ } -+} - - #endif // WT_ASIO_IS_BOOST_ASIO - -Index: wt-4.0.2/src/Wt/Http/Client.C -=================================================================== ---- wt-4.0.2.orig/src/Wt/Http/Client.C -+++ wt-4.0.2/src/Wt/Http/Client.C -@@ -642,7 +642,7 @@ private: - - protected: - asio::io_service& ioService_; -- asio::strand strand_; -+ AsioWrapper::strand strand_; - tcp::resolver resolver_; - asio::streambuf requestBuf_; - asio::streambuf responseBuf_; -@@ -929,8 +929,14 @@ bool Client::request(Http::Method method - - #ifdef WT_WITH_SSL - } else if (parsedUrl.protocol == "https") { -+#if defined(WT_ASIO_IS_BOOST_ASIO) && BOOST_VERSION >= 106600 -+ asio::ssl::context context(asio::ssl::context::tls); -+#elif defined(WT_ASIO_IS_STANDALONE_ASIO) && ASIO_VERSION >= 101100 -+ asio::ssl::context context(asio::ssl::context::sslv23); -+#else - asio::ssl::context context - (*ioService, asio::ssl::context::sslv23); -+#endif - long sslOptions = asio::ssl::context::no_sslv2 | asio::ssl::context::no_sslv3; - context.set_options(sslOptions); - -Index: wt-4.0.2/src/Wt/Http/Client.h -=================================================================== ---- wt-4.0.2.orig/src/Wt/Http/Client.h -+++ wt-4.0.2/src/Wt/Http/Client.h -@@ -23,7 +23,12 @@ - #ifdef WT_ASIO_IS_BOOST_ASIO - namespace boost { - namespace asio { -+#if BOOST_VERSION >= 106600 -+ class io_context; -+ typedef io_context io_service; -+#else - class io_service; -+#endif - } - } - #else // WT_ASIO_IS_STANDALONE_ASIO -Index: wt-4.0.2/src/Wt/Json/Value.h -=================================================================== ---- wt-4.0.2.orig/src/Wt/Json/Value.h -+++ wt-4.0.2/src/Wt/Json/Value.h -@@ -23,7 +23,7 @@ class Array; - * \brief A JSON representation and parsing library. - * - * The JSON library contains data types to represent a JSON data -- * structure (Value, Object and Array), and a JSON parser. -+ * structure (Value, Object and Array), a JSON parser, and a JSON serializer. - * - * Usage example: - * \code -@@ -39,6 +39,9 @@ class Array; - * bool b = result.get("b"); - * std::cerr << "a: " << s << ", b: " << b << std::endl; // a: That's great, b: true - * \endcode -+ * -+ * Include the header for Wt::Json::parse(), and -+ * the header for Wt::Json::serialize(). - */ - - /*! \brief Enumeration for the type of a JSON value. -Index: wt-4.0.2/src/Wt/WDialog.C -=================================================================== ---- wt-4.0.2.orig/src/Wt/WDialog.C -+++ wt-4.0.2/src/Wt/WDialog.C -@@ -436,8 +436,10 @@ void WDialog::render(WFlags - if (!isModal()) - impl_->mouseWentDown().connect(this, &WDialog::bringToFront); - -- if ( flags.test(RenderFlag::Full) && autoFocus_) -- impl_->setFirstFocus(); -+ if ( flags.test(RenderFlag::Full) && autoFocus_) { -+ if (!impl_->findById(Wt::WApplication::instance()->focus())) -+ impl_->setFirstFocus(); -+ } - - WPopupWidget::render(flags); - } -Index: wt-4.0.2/src/Wt/WDialog.h -=================================================================== ---- wt-4.0.2.orig/src/Wt/WDialog.h -+++ wt-4.0.2/src/Wt/WDialog.h -@@ -337,6 +337,9 @@ public: - bool closable() const { return closeIcon_ != nullptr; } - - /*! \brief Set focus on the first widget in the dialog. -+ * -+ * Autofocus is enabled by default. If a widget inside of -+ * this dialog already has focus, the focus will not be changed. - */ - void setAutoFocus(bool enable){ autoFocus_ = enable;} - -Index: wt-4.0.2/src/Wt/WWebWidget.C -=================================================================== ---- wt-4.0.2.orig/src/Wt/WWebWidget.C -+++ wt-4.0.2/src/Wt/WWebWidget.C -@@ -1983,9 +1983,13 @@ bool WWebWidget::setFirstFocus() - return true; - } - -- for (unsigned i = 0; i < children().size(); i++) -- if (children()[i]->setFirstFocus()) -- return true; -+ bool result = false; -+ iterateChildren([&result](Wt::WWidget *w){ -+ if (!result) -+ result = w->setFirstFocus(); -+ }); -+ if (result) -+ return true; - - return false; - } else -@@ -2207,6 +2211,8 @@ WWidget *WWebWidget::findById(const std: - if (!result) - result = c->findById(id); - }); -+ if (result) -+ return result; - } - - return nullptr; -Index: wt-4.0.2/src/http/Connection.C -=================================================================== ---- wt-4.0.2.orig/src/http/Connection.C -+++ wt-4.0.2/src/http/Connection.C -@@ -61,6 +61,15 @@ Connection::~Connection() - LOG_DEBUG("~Connection"); - } - -+asio::ip::tcp::socket::native_handle_type Connection::native() -+{ -+#if (defined(WT_ASIO_IS_BOOST_ASIO) && BOOST_VERSION >= 106600) || (defined(WT_ASIO_IS_STANDALONE_ASIO) && ASIO_VERSION >= 101100) -+ return socket().native_handle(); -+#else -+ return socket().native(); -+#endif -+} -+ - void Connection::finishReply() - { - if (!request_.uri.empty()) { -@@ -78,7 +87,7 @@ void Connection::scheduleStop() - - void Connection::start() - { -- LOG_DEBUG(socket().native() << ": start()"); -+ LOG_DEBUG(native() << ": start()"); - - request_parser_.reset(); - request_.reset(); -@@ -106,7 +115,7 @@ void Connection::stop() - void Connection::setReadTimeout(int seconds) - { - if (seconds != 0) { -- LOG_DEBUG(socket().native() << " setting read timeout (ws: " -+ LOG_DEBUG(native() << " setting read timeout (ws: " - << request_.webSocketVersion << ")"); - state_ |= Reading; - -@@ -118,7 +127,7 @@ void Connection::setReadTimeout(int seco - - void Connection::setWriteTimeout(int seconds) - { -- LOG_DEBUG(socket().native() << " setting write timeout (ws: " -+ LOG_DEBUG(native() << " setting write timeout (ws: " - << request_.webSocketVersion << ")"); - state_ |= Writing; - -@@ -129,7 +138,7 @@ void Connection::setWriteTimeout(int sec - - void Connection::cancelReadTimer() - { -- LOG_DEBUG(socket().native() << " cancel read timeout"); -+ LOG_DEBUG(native() << " cancel read timeout"); - state_.clear(Reading); - - readTimer_.cancel(); -@@ -137,7 +146,7 @@ void Connection::cancelReadTimer() - - void Connection::cancelWriteTimer() - { -- LOG_DEBUG(socket().native() << " cancel write timeout"); -+ LOG_DEBUG(native() << " cancel write timeout"); - state_.clear(Writing); - - writeTimer_.cancel(); -@@ -163,7 +172,7 @@ void Connection::handleReadRequest0() - - #ifdef DEBUG - try { -- LOG_DEBUG(socket().native() << "incoming request: " -+ LOG_DEBUG(socket().native_handle() << "incoming request: " - << socket().remote_endpoint().port() << " (avail= " - << (rcv_buffer_size_ - (rcv_remaining_ - buffer.data())) << "): " - << std::string(rcv_remaining_, -@@ -189,7 +198,7 @@ void Connection::handleReadRequest0() - if (doWebSockets) - request_.enableWebSocket(); - -- LOG_DEBUG(socket().native() << "request: " << status); -+ LOG_DEBUG(native() << "request: " << status); - - if (status >= 300) - sendStockReply(status); -@@ -242,7 +251,7 @@ void Connection::sendStockReply(StockRep - void Connection::handleReadRequest(const Wt::AsioWrapper::error_code& e, - std::size_t bytes_transferred) - { -- LOG_DEBUG(socket().native() << ": handleReadRequest(): " << e.message()); -+ LOG_DEBUG(native() << ": handleReadRequest(): " << e.message()); - - cancelReadTimer(); - -@@ -261,7 +270,7 @@ void Connection::close() - cancelReadTimer(); - cancelWriteTimer(); - -- LOG_DEBUG(socket().native() << ": close()"); -+ LOG_DEBUG(native() << ": close()"); - - ConnectionManager_.stop(shared_from_this()); - } -@@ -274,7 +283,7 @@ bool Connection::closed() const - - void Connection::handleError(const Wt::AsioWrapper::error_code& e) - { -- LOG_DEBUG(socket().native() << ": error: " << e.message()); -+ LOG_DEBUG(native() << ": error: " << e.message()); - - close(); - } -@@ -349,7 +358,7 @@ void Connection::handleReadBody0(ReplyPt - const Wt::AsioWrapper::error_code& e, - std::size_t bytes_transferred) - { -- LOG_DEBUG(socket().native() << ": handleReadBody0(): " << e.message()); -+ LOG_DEBUG(native() << ": handleReadBody0(): " << e.message()); - - if (disconnectCallback_) { - if (e && e != asio::error::operation_aborted) { -@@ -357,7 +366,7 @@ void Connection::handleReadBody0(ReplyPt - disconnectCallback_ = boost::function(); - f(); - } else if (!e) { -- LOG_ERROR(socket().native() -+ LOG_ERROR(native() - << ": handleReadBody(): while waiting for disconnect, " - "received unexpected data, closing"); - close(); -@@ -410,7 +419,7 @@ void Connection::startWriteResponse(Repl - } - #endif - -- LOG_DEBUG(socket().native() << " sending: " << s << "(buffers: " -+ LOG_DEBUG(native() << " sending: " << s << "(buffers: " - << buffers.size() << ")"); - - if (!buffers.empty()) { -@@ -423,7 +432,7 @@ void Connection::startWriteResponse(Repl - - void Connection::handleWriteResponse(ReplyPtr reply) - { -- LOG_DEBUG(socket().native() << ": handleWriteResponse() " << -+ LOG_DEBUG(native() << ": handleWriteResponse() " << - haveResponse_ << " " << responseDone_); - if (haveResponse_) - startWriteResponse(reply); -@@ -458,7 +467,7 @@ void Connection::handleWriteResponse0(Re - const Wt::AsioWrapper::error_code& e, - std::size_t bytes_transferred) - { -- LOG_DEBUG(socket().native() << ": handleWriteResponse0(): " -+ LOG_DEBUG(native() << ": handleWriteResponse0(): " - << bytes_transferred << " ; " << e.message()); - - cancelWriteTimer(); -Index: wt-4.0.2/src/http/Connection.h -=================================================================== ---- wt-4.0.2.orig/src/http/Connection.h -+++ wt-4.0.2/src/http/Connection.h -@@ -18,6 +18,7 @@ - #define HTTP_CONNECTION_HPP - - #include -+#include - #include - - #include "Buffer.h" -@@ -61,7 +62,7 @@ public: - virtual ~Connection(); - - Server *server() const { return server_; } -- asio::strand& strand() { return strand_; } -+ Wt::AsioWrapper::strand& strand() { return strand_; } - - /// Stop all asynchronous operations associated with the connection. - void scheduleStop(); -@@ -86,6 +87,9 @@ public: - const std::function& callback); - - protected: -+ /// Get the native handle of the socket -+ asio::ip::tcp::socket::native_handle_type native(); -+ - void handleWriteResponse0(ReplyPtr reply, - const Wt::AsioWrapper::error_code& e, - std::size_t bytes_transferred); -@@ -104,7 +108,7 @@ protected: - /// The manager for this connection. - ConnectionManager& ConnectionManager_; - -- asio::strand strand_; -+ Wt::AsioWrapper::strand strand_; - - void finishReply(); - -Index: wt-4.0.2/src/http/Reply.C -=================================================================== ---- wt-4.0.2.orig/src/http/Reply.C -+++ wt-4.0.2/src/http/Reply.C -@@ -596,7 +596,8 @@ bool Reply::encodeNextContentBuffer( - originalSize += bs; - - gzipStrm_.avail_in = bs; -- gzipStrm_.next_in = (unsigned char *)asio::detail::buffer_cast_helper(b); -+ gzipStrm_.next_in = const_cast( -+ asio::buffer_cast(b)); - - unsigned char out[16*1024]; - do { -Index: wt-4.0.2/src/http/Server.C -=================================================================== ---- wt-4.0.2.orig/src/http/Server.C -+++ wt-4.0.2/src/http/Server.C -@@ -116,7 +116,11 @@ Server::Server(const Configuration& conf - accept_strand_(wt_.ioService()), - // post_strand_(ioService_), - #ifdef HTTP_WITH_SSL -+#if (defined(WT_ASIO_IS_BOOST_ASIO) && BOOST_VERSION >= 106600) || (defined(WT_ASIO_IS_STANDALONE_ASIO) && ASIO_VERSION >= 101100) -+ ssl_context_(asio::ssl::context::sslv23), -+#else - ssl_context_(wt_.ioService(), asio::ssl::context::sslv23), -+#endif - #endif // HTTP_WITH_SSL - connection_manager_(), - sessionManager_(0), -Index: wt-4.0.2/src/http/Server.h -=================================================================== ---- wt-4.0.2.orig/src/http/Server.h -+++ wt-4.0.2/src/http/Server.h -@@ -129,7 +129,7 @@ private: - Wt::WLogger accessLogger_; - - /// The strand for handleTcpAccept(), handleSslAccept() and handleStop() -- asio::strand accept_strand_; -+ Wt::AsioWrapper::strand accept_strand_; - - /// Acceptors used to listen for incoming http connections. - std::vector tcp_listeners_; -Index: wt-4.0.2/src/http/SessionProcess.C -=================================================================== ---- wt-4.0.2.orig/src/http/SessionProcess.C -+++ wt-4.0.2/src/http/SessionProcess.C -@@ -16,6 +16,7 @@ - #include - #endif // WT_WIN32 - -+#include "Wt/WConfig.h" - #include "Wt/WLogger.h" - - namespace Wt { -@@ -80,7 +81,11 @@ void SessionProcess::asyncExec(const Con - if (!ec) - acceptor_->listen(0, ec); - #ifndef WT_WIN32 -+#if (defined(WT_ASIO_IS_BOOST_ASIO) && BOOST_VERSION >= 106600) || (defined(WT_ASIO_IS_STANDALONE_ASIO) && ASIO_VERSION >= 101100) -+ fcntl(acceptor_->native_handle(), F_SETFD, FD_CLOEXEC); -+#else - fcntl(acceptor_->native(), F_SETFD, FD_CLOEXEC); -+#endif - #endif // !WT_WIN32 - if (ec) { - LOG_ERROR("Couldn't create listening socket: " << ec.message()); -Index: wt-4.0.2/src/http/SslConnection.C -=================================================================== ---- wt-4.0.2.orig/src/http/SslConnection.C -+++ wt-4.0.2/src/http/SslConnection.C -@@ -81,9 +81,9 @@ void SslConnection::handleHandshake(cons - - void SslConnection::stop() - { -- LOG_DEBUG(socket().native() << ": stop()"); -+ LOG_DEBUG(native() << ": stop()"); - finishReply(); -- LOG_DEBUG(socket().native() << ": SSL shutdown"); -+ LOG_DEBUG(native() << ": SSL shutdown"); - - Connection::stop(); - -@@ -108,20 +108,20 @@ void SslConnection::stopNextLayer(const - // In case of timeout, we will get here twice. - sslShutdownTimer_.cancel(); - if (ec) { -- LOG_DEBUG(socket().native() << ": ssl_shutdown failed:" -+ LOG_DEBUG(native() << ": ssl_shutdown failed:" - << ec.message()); - } - try { - if (socket().is_open()) { - Wt::AsioWrapper::error_code ignored_ec; -- LOG_DEBUG(socket().native() << ": socket shutdown"); -+ LOG_DEBUG(native() << ": socket shutdown"); - socket().shutdown(asio::ip::tcp::socket::shutdown_both, - ignored_ec); -- LOG_DEBUG(socket().native() << "closing socket"); -+ LOG_DEBUG(native() << "closing socket"); - socket().close(); - } - } catch (Wt::AsioWrapper::system_error& e) { -- LOG_DEBUG(socket().native() << ": error " << e.what()); -+ LOG_DEBUG(native() << ": error " << e.what()); - } - } - -@@ -161,7 +161,7 @@ void SslConnection::startAsyncReadBody(R - Buffer& buffer, int timeout) - { - if (state_ & Reading) { -- LOG_DEBUG(socket().native() << ": state_ = " -+ LOG_DEBUG(native() << ": state_ = " - << (state_ & Reading ? "reading " : "") - << (state_ & Writing ? "writing " : "")); - stop(); -@@ -198,7 +198,7 @@ void SslConnection - int timeout) - { - if (state_ & Writing) { -- LOG_DEBUG(socket().native() << ": state_ = " -+ LOG_DEBUG(native() << ": state_ = " - << (state_ & Reading ? "reading " : "") - << (state_ & Writing ? "writing " : "")); - stop(); -Index: wt-4.0.2/src/http/TcpConnection.C -=================================================================== ---- wt-4.0.2.orig/src/http/TcpConnection.C -+++ wt-4.0.2/src/http/TcpConnection.C -@@ -38,17 +38,17 @@ asio::ip::tcp::socket& TcpConnection::so - - void TcpConnection::stop() - { -- LOG_DEBUG(socket().native() << ": stop()"); -+ LOG_DEBUG(native() << ": stop()"); - - finishReply(); - - try { - Wt::AsioWrapper::error_code ignored_ec; - socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec); -- LOG_DEBUG(socket().native() << ": closing socket"); -+ LOG_DEBUG(native() << ": closing socket"); - socket_.close(); - } catch (Wt::AsioWrapper::system_error& e) { -- LOG_DEBUG(socket().native() << ": error " << e.what()); -+ LOG_DEBUG(native() << ": error " << e.what()); - } - - Connection::stop(); -@@ -56,10 +56,10 @@ void TcpConnection::stop() - - void TcpConnection::startAsyncReadRequest(Buffer& buffer, int timeout) - { -- LOG_DEBUG(socket().native() << ": startAsyncReadRequest"); -+ LOG_DEBUG(native() << ": startAsyncReadRequest"); - - if (state_ & Reading) { -- LOG_DEBUG(socket().native() << ": state_ = " -+ LOG_DEBUG(native() << ": state_ = " - << (state_ & Reading ? "reading " : "") - << (state_ & Writing ? "writing " : "")); - stop(); -@@ -81,10 +81,10 @@ void TcpConnection::startAsyncReadReques - void TcpConnection::startAsyncReadBody(ReplyPtr reply, - Buffer& buffer, int timeout) - { -- LOG_DEBUG(socket().native() << ": startAsyncReadBody"); -+ LOG_DEBUG(native() << ": startAsyncReadBody"); - - if (state_ & Reading) { -- LOG_DEBUG(socket().native() << ": state_ = " -+ LOG_DEBUG(native() << ": state_ = " - << (state_ & Reading ? "reading " : "") - << (state_ & Writing ? "writing " : "")); - stop(); -@@ -109,10 +109,10 @@ void TcpConnection::startAsyncWriteRespo - const std::vector& buffers, - int timeout) - { -- LOG_DEBUG(socket().native() << ": startAsyncWriteResponse"); -+ LOG_DEBUG(native() << ": startAsyncWriteResponse"); - - if (state_ & Writing) { -- LOG_DEBUG(socket().native() << ": state_ = " -+ LOG_DEBUG(native() << ": state_ = " - << (state_ & Reading ? "reading " : "") - << (state_ & Writing ? "writing " : "")); - stop(); -Index: wt-4.0.2/src/web/Configuration.C -=================================================================== ---- wt-4.0.2.orig/src/web/Configuration.C -+++ wt-4.0.2/src/web/Configuration.C -@@ -825,14 +825,10 @@ void Configuration::readApplicationSetti - runDirectory_ = singleChildElementValue(fcgi, "run-directory", - runDirectory_); - -- setInt(fcgi, "num-threads", numThreads_); // backward compatibility < 3.2.0 -- - xml_node<> *isapi = singleChildElement(app, "connector-isapi"); - if (!isapi) - isapi = app; // backward compatibility - -- setInt(isapi, "num-threads", numThreads_); // backward compatibility < 3.2.0 -- - std::string maxMemoryRequestSizeStr = - singleChildElementValue(isapi, "max-memory-request-size", ""); - if (!maxMemoryRequestSizeStr.empty()) { diff --git a/examples-crypt.patch b/examples-crypt.patch deleted file mode 100644 index dea05a2..0000000 --- a/examples-crypt.patch +++ /dev/null @@ -1,24 +0,0 @@ -Index: wt-4.0.2/examples/blog/model/BlogSession.C -=================================================================== ---- wt-4.0.2.orig/examples/blog/model/BlogSession.C -+++ wt-4.0.2/examples/blog/model/BlogSession.C -@@ -28,6 +28,7 @@ - - #if !defined(WT_WIN32) && !defined(__CYGWIN__) && !defined(ANDROID) - #define HAVE_CRYPT -+#include - #endif - - namespace { -Index: wt-4.0.2/examples/hangman/Session.C -=================================================================== ---- wt-4.0.2.orig/examples/hangman/Session.C -+++ wt-4.0.2/examples/hangman/Session.C -@@ -24,6 +24,7 @@ - - #if !defined(WT_WIN32) && !defined(__CYGWIN__) && !defined(ANDROID) - #define HAVE_CRYPT -+#include - #endif - - namespace dbo = Wt::Dbo; diff --git a/sources b/sources index 2305083..40315a2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wt-4.0.2-free.tar.xz) = 8bd6fc043fe7316cafb484200b0f2827b64dcb1336c55f385d6e082baec4affbc31493b4a1155c8710c8ac08ccd11ad6aefa0e944679da65bcb18ffe5017c596 +SHA512 (wt-4.0.3-free.tar.xz) = 80d9c24bec270692324f1db22618875cb514d7f54a4ce285f3517d98c25798619b9c74bd8e717eb83db43edb6cd2da992ded8629d0d239bfdbc5052d56cb19fa diff --git a/wt-4.0.2-PACKAGE-LICENSING b/wt-4.0.3-PACKAGE-LICENSING similarity index 100% rename from wt-4.0.2-PACKAGE-LICENSING rename to wt-4.0.3-PACKAGE-LICENSING diff --git a/wt.spec b/wt.spec index b39420f..7cac590 100644 --- a/wt.spec +++ b/wt.spec @@ -5,8 +5,8 @@ %global WTRUNGROUP apache Name: wt -Version: 4.0.2 -Release: 3%{?dist} +Version: 4.0.3 +Release: 1%{?dist} Summary: C++ library for developing web applications Group: Development/Libraries @@ -30,10 +30,6 @@ Source3: README.fedora Source4: wt-generate-tarball.sh Patch0: use-system-sqlite.patch -# taken from https://github.com/emweb/wt/commit/960e8d017b264710e344c63f9feb6ea1fa593eeb.patch -# author of the patch: Roel Standaert -Patch1: boost-166-compat.patch -Patch2: examples-crypt.patch BuildRequires: cmake >= 3.1 boost-devel >= 1.41 gcc-c++ openssl-devel doxygen BuildRequires: GraphicsMagick-devel pango-devel sqlite-devel postgresql-devel @@ -295,6 +291,9 @@ popd %{_defaultdocdir}/%{name}-doc/examples/* %changelog +* Mon Jul 23 2018 Michal Minář - 4.0.3-1 +- New upstream version 4.0.3 + * Thu Mar 15 2018 Michal Minář - 4.0.2-3 - New upstream version 4.0.2 - Compatibility fix for boost 1.66