From 05a6858dc8e4065205ad3b6b836432d0c56826f4 Mon Sep 17 00:00:00 2001 From: Roel Standaert Date: Tue, 4 Jul 2017 16:10:04 +0200 Subject: [PATCH] Several changes: - Dbo benchmark, resolving warning: make i signed before putting - before it - Added missing include to FixedSqlConnectionPool.C - Issue #5773: make defensive copies of parameters Patch provided by Bruce Toll - WEnvironment: Added notes about lifetime of parameter map - OidcUserInfoEndpoint: skip unknown scopes - Don't name size parameter in Dbo tutorial to avoid warnings - Added Wt 3.3.8 release notes - Don't install release notes separately, they're already part of the reference documentation. - Issue #5780: komma -> comma in doc - Added public vs private linkage description to some target_link_libraries calls - Fixes to make TechEmpower benchmarks example build on Windows - Json: Added missing WT_API to ParseError --- CMakeLists.txt | 2 - ReleaseNotes.html | 71 +++++++++++++++++++ examples/codeview/CMakeLists.txt | 2 +- examples/feature/dbo/tutorial6.C | 2 +- examples/feature/dbo/tutorial8.C | 2 +- examples/feature/dbo/tutorial9/MembershipId.h | 2 +- .../feature/socketnotifier/CMakeLists.txt | 2 + examples/simplechat/CMakeLists.txt | 2 +- examples/te-benchmark/benchmark.cpp | 3 +- src/CMakeLists.txt | 24 ++++--- src/Wt/Auth/OAuthAuthorizationEndpointProcess | 6 +- .../Auth/OAuthAuthorizationEndpointProcess.C | 32 +++++---- src/Wt/Auth/OidcUserInfoEndpoint.C | 7 +- src/Wt/Dbo/FixedSqlConnectionPool.C | 2 + src/Wt/Dbo/backend/CMakeLists.txt | 31 ++++++-- src/Wt/Json/Parser | 2 +- src/Wt/WEnvironment | 21 ++++++ src/Wt/WSuggestionPopup | 2 +- src/http/CMakeLists.txt | 16 +++-- test/dbo/Benchmark.C | 2 +- 20 files changed, 180 insertions(+), 53 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a076625c7f..72c0de8a18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -596,8 +596,6 @@ IF(INSTALL_DOCUMENTATION) ${CMAKE_INSTALL_PREFIX}/${DOCUMENTATION_DESTINATION}/examples) INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/doc/tutorial DESTINATION ${CMAKE_INSTALL_PREFIX}/${DOCUMENTATION_DESTINATION}) - INSTALL(FILES ${PROJECT_SOURCE_DIR}/ReleaseNotes.html DESTINATION - ${CMAKE_INSTALL_PREFIX}/${DOCUMENTATION_DESTINATION}) ENDIF(INSTALL_DOCUMENTATION) IF(NOT EXISTS ${CONFIGDIR}/wt_config.xml) diff --git a/ReleaseNotes.html b/ReleaseNotes.html index 04f18f0446..37826c5701 100644 --- a/ReleaseNotes.html +++ b/ReleaseNotes.html @@ -22,6 +22,77 @@

Wt Release notes

the way you build Wt, the way you configure Wt or the Wt API and behaviour. +

Release 3.3.8 (July 2017)

+

+ This release consists of bug fixes and some new features: +

+
+
+ OpenID Connect support +
+
+ As we've previously announced + on our blog, + Wt now supports OpenID Connect. All you need to do to use any OpenID Connect based service is + configure a Wt::Auth::OidcService. You can also make your + own OpenID Connect identity provider. Check out the accompanying + OpenID Connect feature example. +
+
+ On Windows: font support based on DirectWrite +
+
+

Wt 3.3.7 already introduced the Direct2D backend for WRasterImage. + Wt 3.3.8 further expands + on this by adding DirectWrite-based font support. This means that Wt 3.3.8 will be able to + select the appropriate fonts for every glyph, without requiring Pango. Pango was always + difficult to distribute on Windows, so we never included Pango in the binary distribution, relying on + very basic font support instead, replacing unknown characters by question marks. Now, you + can expect much better Unicode support with DirectWrite on Windows.

+

This means that the binary release of Wt on Windows is now built with Direct2D and DirectWrite.

+
+
+ Wt::Dbo: added sql_value_traits for + Wt::Json::Object and + Wt::Json::Array. +
+
+

Quite often, the need arises to store some unindexed data with arbitrary structure in a database. + A common solution is to store JSON as a string. To facilitate this, we've included implementations + of sql_value_traits for + Wt::Json::Object and + Wt::Json::Array in + Wt/Dbo/WtSqlTraits. This allows you to store Wt::Json Objects and Arrays + just like you any other field.

+

Additionally, we've made the Wt::Json API a bit more friendly, by adding support + for initializer lists (when using C++11), and implicit constructors for + Wt::Json::Value + from + Wt::Json::Object and + Wt::Json::Array.

+
+
+ Other small improvements: +
+
+
    +
  • Any boost::asio::io_service can now be used with Wt::Http::Client, + instead of just Wt::WIOService.
  • +
  • Added support for PATCH requests in WResource and + Wt::Http::Client, + next to GET, POST, PUT, and DELETE. +
  • wthttp connector: added support for forward secrecy with the --ssl-prefer-server-ciphers option.
  • +
  • Added the num-session-threads configuration parameter, to set the amount of threads per session when + using dedicated process mode. By default, the main process and the session threads use the same amount of threads.
  • +
  • The te-benchmark + example was added, implementing the TechEmpower framework benchmarks. + This example also demonstrates how Wt can be used to write RESTful services. Improved, less verbose, support for + RESTful services is planned in a future release.
  • +
  • Added Wt::Dbo::FixedSqlConnectionPool::setTimeout(), to set a timeout for obtaining a connection.
  • +
+
+
+

Release 3.3.7 (March 31, 2017)

This release fixes many bugs, but also introduces some new features: diff --git a/examples/codeview/CMakeLists.txt b/examples/codeview/CMakeLists.txt index 2331ea2f6c..ab37032060 100644 --- a/examples/codeview/CMakeLists.txt +++ b/examples/codeview/CMakeLists.txt @@ -10,7 +10,7 @@ ELSE(NOT MULTI_THREADED_BUILD) CoderApplication.C CodeSession.C CoderWidget.C ObserverWidget.C ) - TARGET_LINK_LIBRARIES(codingview.wt ${BOOST_THREAD_LIB}) + TARGET_LINK_LIBRARIES(codingview.wt ${BOOST_THREAD_LIB} ${CMAKE_THREAD_LIBS_INIT}) INCLUDE_DIRECTORIES(${WT_SOURCE_DIR}/src) diff --git a/examples/feature/dbo/tutorial6.C b/examples/feature/dbo/tutorial6.C index 7b65cad484..f924a6e6de 100644 --- a/examples/feature/dbo/tutorial6.C +++ b/examples/feature/dbo/tutorial6.C @@ -52,7 +52,7 @@ namespace Wt { template void field(Action& action, Coordinate& coordinate, const std::string& name, - int size = -1) + int /*size*/ = -1) { field(action, coordinate.x, name + "_x"); field(action, coordinate.y, name + "_y"); diff --git a/examples/feature/dbo/tutorial8.C b/examples/feature/dbo/tutorial8.C index 11d29f82e6..83c06450ae 100644 --- a/examples/feature/dbo/tutorial8.C +++ b/examples/feature/dbo/tutorial8.C @@ -58,7 +58,7 @@ namespace Wt { template void field(Action& action, MembershipId& mid, const std::string& name, - int size = -1) + int /*size*/ = -1) { /* * Note: here we ignore name because MembershipId is used only diff --git a/examples/feature/dbo/tutorial9/MembershipId.h b/examples/feature/dbo/tutorial9/MembershipId.h index f54032520e..0ef13eb5c3 100644 --- a/examples/feature/dbo/tutorial9/MembershipId.h +++ b/examples/feature/dbo/tutorial9/MembershipId.h @@ -75,7 +75,7 @@ namespace Wt template void field(Action& action, MembershipId& mid, const std::string& name, - int size = -1) + int /*size*/ = -1) { /* * Note: here we ignore name because MembershipId is used only diff --git a/examples/feature/socketnotifier/CMakeLists.txt b/examples/feature/socketnotifier/CMakeLists.txt index 7a23aab1fb..4b509f9cd9 100644 --- a/examples/feature/socketnotifier/CMakeLists.txt +++ b/examples/feature/socketnotifier/CMakeLists.txt @@ -15,6 +15,8 @@ ELSE(NOT MULTI_THREADED_BUILD) # instead of the following: # INCLUDE_DIRECTORIES(${WT_SOURCE_DIR}/src) + + TARGET_LINK_LIBRARIES(socketnotifier.wt ${WT_SOCKET_LIBRARY}) ENDIF (MINGW) ENDIF(NOT MULTI_THREADED_BUILD) diff --git a/examples/simplechat/CMakeLists.txt b/examples/simplechat/CMakeLists.txt index 451b1bdca7..c76943d698 100644 --- a/examples/simplechat/CMakeLists.txt +++ b/examples/simplechat/CMakeLists.txt @@ -11,7 +11,7 @@ ELSE(NOT MULTI_THREADED_BUILD) SimpleChatServer.C ) - TARGET_LINK_LIBRARIES(simplechat.wt ${BOOST_THREAD_LIB}) + TARGET_LINK_LIBRARIES(simplechat.wt ${BOOST_THREAD_LIB} ${CMAKE_THREAD_LIBS_INIT}) # # If you have Wt installed somehwere, you should use the diff --git a/examples/te-benchmark/benchmark.cpp b/examples/te-benchmark/benchmark.cpp index 7ec13e36f6..9a7708cfe2 100644 --- a/examples/te-benchmark/benchmark.cpp +++ b/examples/te-benchmark/benchmark.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include @@ -357,8 +356,10 @@ int main(int argc, char** argv) { std::cerr << "Shutdown (signal = " << sig << ")" << std::endl; server.stop(); +#ifndef WT_WIN32 if (sig == SIGHUP) Wt::WServer::restart(argc, argv, environ); +#endif // WT_WIN32 } } catch (Wt::WServer::Exception& e) { std::cerr << e.what() << "\n"; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ff2f48ca06..6246d0276c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -463,7 +463,9 @@ ENDIF(WIN32) ADD_LIBRARY(wt ${libsources}) TARGET_LINK_LIBRARIES(wt + PUBLIC ${BOOST_WT_LIBRARIES} + PRIVATE ${WT_SOCKET_LIBRARY} ${WT_MATH_LIBRARY} ${RT_LIBRARY} @@ -498,7 +500,7 @@ ELSE(ENABLE_LIBWTTEST) ENDIF(ENABLE_LIBWTTEST) IF(HAVE_SSL) - TARGET_LINK_LIBRARIES(wt ${SSL_LIBRARIES}) + TARGET_LINK_LIBRARIES(wt PRIVATE ${SSL_LIBRARIES}) INCLUDE_DIRECTORIES(${SSL_INCLUDE_DIRS}) ELSE(HAVE_SSL) MESSAGE("** Disabling crypto support (Auth::SHA1HashFunction, HTTPS support): requires OpenSSL.") @@ -508,7 +510,7 @@ ELSE(HAVE_SSL) ENDIF(HAVE_SSL) IF(HAVE_HARU) - TARGET_LINK_LIBRARIES(wt ${HARU_LIBRARIES}) + TARGET_LINK_LIBRARIES(wt PUBLIC ${HARU_LIBRARIES}) INCLUDE_DIRECTORIES(${HARU_INCLUDE_DIRS}) ELSE(HAVE_HARU) MESSAGE("** Disabling PDF support (WPdfImage, WPdfRenderer): requires libharu.") @@ -518,15 +520,15 @@ ELSE(HAVE_HARU) ENDIF(HAVE_HARU) IF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "GraphicsMagick") - TARGET_LINK_LIBRARIES(wt ${GM_LIBRARIES}) + TARGET_LINK_LIBRARIES(wt PRIVATE ${GM_LIBRARIES}) INCLUDE_DIRECTORIES(${GM_INCLUDE_DIRS}) ADD_DEFINITIONS(-DHAVE_GRAPHICSMAGICK) ELSEIF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "skia") - TARGET_LINK_LIBRARIES(wt ${SKIA_LIBRARIES}) + TARGET_LINK_LIBRARIES(wt PRIVATE ${SKIA_LIBRARIES}) INCLUDE_DIRECTORIES(${SKIA_INCLUDE_DIRS}) ADD_DEFINITIONS(${SKIA_DEFINES}) ELSEIF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "Direct2D") - TARGET_LINK_LIBRARIES(wt D2d1 Dwrite Windowscodecs Shlwapi) + TARGET_LINK_LIBRARIES(wt PRIVATE D2d1 Dwrite Windowscodecs Shlwapi) ELSE("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "GraphicsMagick") MESSAGE("** Disabling raster image support (WRasterImage): set WT_WRASTERIMAGE_IMPLEMENTATION to GraphicsMagick or skia.") ENDIF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "GraphicsMagick") @@ -534,9 +536,9 @@ ENDIF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "GraphicsMagick") IF(HAVE_GL) INCLUDE_DIRECTORIES(${GL_INCLUDE_DIRS}) IF(USE_SYSTEM_GLEW) - TARGET_LINK_LIBRARIES(wt GLEW) + TARGET_LINK_LIBRARIES(wt PRIVATE GLEW) ENDIF(USE_SYSTEM_GLEW) - TARGET_LINK_LIBRARIES(wt ${GL_LIBRARIES}) + TARGET_LINK_LIBRARIES(wt PRIVATE ${GL_LIBRARIES}) ELSE(HAVE_GL) MESSAGE("** Disabling server-side opengl rendering for WGLWidget: requires gl, glew and WRasterImage (GraphicsMagick or skia).") ENDIF(HAVE_GL) @@ -548,18 +550,18 @@ IF(WT_FONTSUPPORT_SIMPLE) MESSAGE(" Wt will use pkg-config to retrieve your libpango installation location.") ENDIF(ENABLE_PANGO) ELSEIF(WT_FONTSUPPORT_PANGO) - TARGET_LINK_LIBRARIES(wt ${PANGO_FT2_LIBRARIES}) + TARGET_LINK_LIBRARIES(wt PRIVATE ${PANGO_FT2_LIBRARIES}) INCLUDE_DIRECTORIES(${PANGO_FT2_INCLUDE_DIRS}) ADD_DEFINITIONS(-DWT_FONTSUPPORT_PANGO) MESSAGE("** Enabling advanced font support using libpango") ELSEIF(WT_FONTSUPPORT_DIRECTWRITE) - TARGET_LINK_LIBRARIES(wt Dwrite) + TARGET_LINK_LIBRARIES(wt PRIVATE Dwrite) ADD_DEFINITIONS(-DWT_FONTSUPPORT_DIRECTWRITE) MESSAGE("** Enabling advanced font support using DirectWrite") ENDIF(WT_FONTSUPPORT_SIMPLE) IF(MULTI_THREADED_BUILD) - TARGET_LINK_LIBRARIES(wt ${CMAKE_THREAD_LIBS_INIT}) + TARGET_LINK_LIBRARIES(wt PRIVATE ${CMAKE_THREAD_LIBS_INIT}) ENDIF(MULTI_THREADED_BUILD) INSTALL(TARGETS wt @@ -583,7 +585,7 @@ PROPERTIES IF(MSVC) SET_TARGET_PROPERTIES(wt PROPERTIES COMPILE_FLAGS "${BUILD_PARALLEL} /wd4251 /wd4275 /wd4355 /wd4800 /wd4996 /wd4101 /wd4267") - TARGET_LINK_LIBRARIES(wt winmm) + TARGET_LINK_LIBRARIES(wt PRIVATE winmm) ENDIF(MSVC) SUBDIRS(isapi fcgi http) diff --git a/src/Wt/Auth/OAuthAuthorizationEndpointProcess b/src/Wt/Auth/OAuthAuthorizationEndpointProcess index 97192009b9..a55ad20150 100644 --- a/src/Wt/Auth/OAuthAuthorizationEndpointProcess +++ b/src/Wt/Auth/OAuthAuthorizationEndpointProcess @@ -131,9 +131,9 @@ protected: private: void sendResponse(const std::string& param); int authCodeExpSecs_; - const std::string *redirectUri_; - const std::string *state_; - const std::string *scope_; + std::string redirectUri_; + std::string state_; + std::string scope_; OAuthClient client_; bool validRequest_; Login& login_; diff --git a/src/Wt/Auth/OAuthAuthorizationEndpointProcess.C b/src/Wt/Auth/OAuthAuthorizationEndpointProcess.C index 526c308865..b7b3c7e65c 100644 --- a/src/Wt/Auth/OAuthAuthorizationEndpointProcess.C +++ b/src/Wt/Auth/OAuthAuthorizationEndpointProcess.C @@ -37,11 +37,13 @@ OAuthAuthorizationEndpointProcess::OAuthAuthorizationEndpointProcess( void OAuthAuthorizationEndpointProcess::processEnvironment() { const WEnvironment& env = WApplication::instance()->environment(); - redirectUri_ = env.getParameter("redirect_uri"); - if (!redirectUri_) { + const std::string *redirectUri = env.getParameter("redirect_uri"); + if (!redirectUri) { LOG_ERROR("The client application did not pass a redirection URI."); return; } + redirectUri_ = *redirectUri; + const std::string *clientId = env.getParameter("client_id"); if (!clientId) { LOG_ERROR("Missing client_id parameter."); @@ -53,23 +55,27 @@ void OAuthAuthorizationEndpointProcess::processEnvironment() return; } std::set redirectUris = client_.redirectUris(); - if (redirectUris.find(*redirectUri_) == redirectUris.end()) { + if (redirectUris.find(redirectUri_) == redirectUris.end()) { LOG_ERROR("The client application passed an unregistered redirection URI."); return; } - scope_ = env.getParameter("scope"); + const std::string *scope = env.getParameter("scope"); const std::string *responseType = env.getParameter("response_type"); - state_ = env.getParameter("state"); - if (!scope_ || !responseType || *responseType != "code") { + const std::string *state = env.getParameter("state"); + if (!scope || !responseType || *responseType != "code") { sendResponse("error=invalid_request"); return; } validRequest_ = true; + scope_ = *scope; + + if (state) + state_ = *state; login_.changed().connect(this, &OAuthAuthorizationEndpointProcess::authEvent); const std::string *prompt = WApplication::instance()->environment().getParameter("prompt"); if (login_.loggedIn()) { - authorized_.emit(*scope_); + authorized_.emit(scope_); return; } else if (prompt && *prompt == "none") { sendResponse("error=login_required"); @@ -83,7 +89,7 @@ void OAuthAuthorizationEndpointProcess::authorizeScope(const std::string& scope) std::string authCodeValue = WRandom::generateId(); WDateTime expirationTime = WDateTime::currentDateTime().addSecs(authCodeExpSecs_); db_->idpTokenAdd(authCodeValue, expirationTime, "authorization_code", scope, - *redirectUri_, login_.user(), client_); + redirectUri_, login_.user(), client_); sendResponse("code=" + authCodeValue); } else { throw WException("Wt::Auth::OAuthAuthorizationEndpointProcess::authorizeScope: request isn't valid"); @@ -93,7 +99,7 @@ void OAuthAuthorizationEndpointProcess::authorizeScope(const std::string& scope) void OAuthAuthorizationEndpointProcess::authEvent() { if (login_.loggedIn()) { - authorized_.emit(*scope_); + authorized_.emit(scope_); } else { sendResponse("error=login_required"); } @@ -101,11 +107,11 @@ void OAuthAuthorizationEndpointProcess::authEvent() void OAuthAuthorizationEndpointProcess::sendResponse(const std::string& param) { - std::string redirectParam = redirectUri_->find("?") != std::string::npos ? "&" : "?"; + std::string redirectParam = redirectUri_.find("?") != std::string::npos ? "&" : "?"; redirectParam += param; - if (state_) - redirectParam += "&state=" + Utils::urlEncode(*state_); - WApplication::instance()->redirect(*redirectUri_ + redirectParam); + if (!state_.empty()) + redirectParam += "&state=" + Utils::urlEncode(state_); + WApplication::instance()->redirect(redirectUri_ + redirectParam); } void OAuthAuthorizationEndpointProcess::setAuthCodeExpSecs(int seconds) diff --git a/src/Wt/Auth/OidcUserInfoEndpoint.C b/src/Wt/Auth/OidcUserInfoEndpoint.C index 5256425f55..f17d8ad554 100644 --- a/src/Wt/Auth/OidcUserInfoEndpoint.C +++ b/src/Wt/Auth/OidcUserInfoEndpoint.C @@ -75,7 +75,12 @@ Json::Object OidcUserInfoEndpoint::generateUserInfo(const User& user, const std: root["sub"] = Json::Value(user.id()); std::set claims; for (std::set::iterator s = scope.begin(); s != scope.end(); ++s) { - const std::set& c = claimMap_.find(*s)->second; + std::map >::const_iterator it + = claimMap_.find(*s); + if (it == claimMap_.end()) + continue; + + const std::set& c = it->second; for (std::set::iterator s2 = c.begin(); s2 != c.end(); ++s2) claims.insert(*s2); } diff --git a/src/Wt/Dbo/FixedSqlConnectionPool.C b/src/Wt/Dbo/FixedSqlConnectionPool.C index 8a4d4ba780..c300912292 100644 --- a/src/Wt/Dbo/FixedSqlConnectionPool.C +++ b/src/Wt/Dbo/FixedSqlConnectionPool.C @@ -14,6 +14,8 @@ #else #endif // WT_THREADED +#include + namespace Wt { namespace Dbo { diff --git a/src/Wt/Dbo/backend/CMakeLists.txt b/src/Wt/Dbo/backend/CMakeLists.txt index 37e484a5dc..bcc50c07a5 100755 --- a/src/Wt/Dbo/backend/CMakeLists.txt +++ b/src/Wt/Dbo/backend/CMakeLists.txt @@ -47,7 +47,10 @@ IF(ENABLE_SQLITE) MESSAGE("** Wt::Dbo: building SQLite3 backend.") - TARGET_LINK_LIBRARIES(wtdbosqlite3 wtdbo + TARGET_LINK_LIBRARIES(wtdbosqlite3 + PUBLIC + wtdbo + PRIVATE ${SQLITE3_LIBRARIES} ${BOOST_DT_LIB} ${WT_THREAD_LIB} @@ -60,7 +63,7 @@ IF(ENABLE_SQLITE) dl ) IF(DL_LIB) - TARGET_LINK_LIBRARIES(wtdbosqlite3 ${DL_LIB}) + TARGET_LINK_LIBRARIES(wtdbosqlite3 PRIVATE ${DL_LIB}) ENDIF(DL_LIB) ENDIF(NOT WIN32) @@ -112,7 +115,13 @@ IF(ENABLE_POSTGRES AND POSTGRES_FOUND) Postgres.C ${postgres_SRCS} ) - TARGET_LINK_LIBRARIES(wtdbopostgres wtdbo ${POSTGRES_LIBRARIES} ${BOOST_DT_LIB}) + TARGET_LINK_LIBRARIES(wtdbopostgres + PUBLIC + wtdbo + PRIVATE + ${POSTGRES_LIBRARIES} + ${BOOST_DT_LIB} + ) INCLUDE_DIRECTORIES(${POSTGRES_INCLUDE}) @@ -184,9 +193,11 @@ IF(ENABLE_FIREBIRD AND FIREBIRD_FOUND) ${firebird_SRCS} ) TARGET_LINK_LIBRARIES(wtdbofirebird - wtdbo - ${FIREBIRD_LIBRARIES} - ${BOOST_DT_LIB} + PUBLIC + wtdbo + PRIVATE + ${FIREBIRD_LIBRARIES} + ${BOOST_DT_LIB} ) IF(MSVC) @@ -244,7 +255,13 @@ IF(ENABLE_MYSQL AND MYSQL_FOUND) MySQL.C ${mysql_SRCS} ) - TARGET_LINK_LIBRARIES(wtdbomysql wtdbo ${MYSQL_LIBRARIES} ${BOOST_DT_LIB}) + TARGET_LINK_LIBRARIES(wtdbomysql + PUBLIC + wtdbo + PRIVATE + ${MYSQL_LIBRARIES} + ${BOOST_DT_LIB} + ) INCLUDE_DIRECTORIES(${MYSQL_INCLUDE}) diff --git a/src/Wt/Json/Parser b/src/Wt/Json/Parser index bfe979c76a..109f5c8cd6 100644 --- a/src/Wt/Json/Parser +++ b/src/Wt/Json/Parser @@ -23,7 +23,7 @@ class Array; * * \ingroup json */ -class ParseError : public WException +class WT_API ParseError : public WException { public: ParseError(); diff --git a/src/Wt/WEnvironment b/src/Wt/WEnvironment index 1e3caad8d7..825fcd67dc 100644 --- a/src/Wt/WEnvironment +++ b/src/Wt/WEnvironment @@ -146,6 +146,13 @@ public: * Arguments passed to the application, either in the URL for a * http GET, or in both the URL and data submitted in a http POST. * + * \if cpp + * \note The parameter map will be updated when the page is refreshed + * (e.g. in non-Ajax sessions and when reload-is-new-session is false), + * so you will have to make a copy of values in the parameter map if you want + * to preserve them across different requests. + * \endif + * * \sa getParameterValues() */ const Http::ParameterMap& getParameterMap() const { return parameters_; } @@ -161,6 +168,13 @@ public: * both values "Hello" and "World" to be * associated with the argument "hello". * + * \if cpp + * \note The parameter map will be updated when the page is refreshed + * (e.g. in non-Ajax sessions and when reload-is-new-session is false), + * so you will have to make a copy of these values to preserve it across + * different requests. + * \endif + * * \sa getParameterMap() */ const Http::ParameterValues& getParameterValues(const std::string& name) @@ -171,6 +185,13 @@ public: * Returns the first value for a parameter, or \c 0 if the parameter is * not found. * + * \if cpp + * \note The parameter map will be updated when the page is refreshed + * (e.g. in non-Ajax sessions and when reload-is-new-session is false), + * so you will have to make a copy of the returned string if you want to + * preserve this parameter across different requests. + * \endif + * * \sa getParameterValues() */ const std::string *getParameter(const std::string& name) const; diff --git a/src/Wt/WSuggestionPopup b/src/Wt/WSuggestionPopup index 2be0a7f61e..afd4917345 100644 --- a/src/Wt/WSuggestionPopup +++ b/src/Wt/WSuggestionPopup @@ -213,7 +213,7 @@ public: /*! \brief When editing a list of values, the separator used * for different items. * - * For example, ',' to separate different values on komma. Specify + * For example, ',' to separate different values on comma. Specify * 0 ('\\0') for no list separation. * * Used during matching and replacing. diff --git a/src/http/CMakeLists.txt b/src/http/CMakeLists.txt index b666fc2624..415af8fdda 100644 --- a/src/http/CMakeLists.txt +++ b/src/http/CMakeLists.txt @@ -86,16 +86,18 @@ IF(CONNECTOR_HTTP) ADD_LIBRARY(wthttp ${libhttpsources}) TARGET_LINK_LIBRARIES(wthttp - wt - ${MY_ZLIB_LIBS} - ${MY_SSL_LIBS} - ${BOOST_WTHTTP_LIBRARIES} - ${WT_SOCKET_LIBRARY} - ${WIN32_STRSTRI_LIB} + PUBLIC + wt + PRIVATE + ${MY_ZLIB_LIBS} + ${MY_SSL_LIBS} + ${BOOST_WTHTTP_LIBRARIES} + ${WT_SOCKET_LIBRARY} + ${WIN32_STRSTRI_LIB} ) IF(BOOST_WT_MT_FOUND) - TARGET_LINK_LIBRARIES(wthttp ${CMAKE_THREAD_LIBS_INIT}) + TARGET_LINK_LIBRARIES(wthttp PRIVATE ${CMAKE_THREAD_LIBS_INIT}) ENDIF(BOOST_WT_MT_FOUND) INSTALL(TARGETS wthttp diff --git a/test/dbo/Benchmark.C b/test/dbo/Benchmark.C index 16e1b64c1f..6af005ca80 100644 --- a/test/dbo/Benchmark.C +++ b/test/dbo/Benchmark.C @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE( performance_test ) p->id = i; p->text = text; - p->creation_date = Wt::WDateTime::currentDateTime().addSecs(-i * 60 * 60); + p->creation_date = Wt::WDateTime::currentDateTime().addSecs(-(int)i * 60 * 60); p->last_change_date = Wt::WDateTime::currentDateTime(); for (unsigned k = 0; k < 10; ++k)