# HG changeset patch # User Sebastien Jodogne # Date 1546089403 -3600 # Node ID ad37c21ec4db20fe2a61202a755332d0134c740a # Parent b89a4288d60521c924be884141d490d7ed938bef fix compatibility with civetweb 1.11 diff -r b89a4288d605 -r ad37c21ec4db Core/HttpServer/MongooseServer.cpp --- a/Core/HttpServer/MongooseServer.cpp Wed Dec 26 11:15:17 2018 +0100 +++ b/Core/HttpServer/MongooseServer.cpp Sat Dec 29 14:16:43 2018 +0100 @@ -669,18 +669,27 @@ reinterpret_cast(&request->remote_ip) [2], reinterpret_cast(&request->remote_ip) [1], reinterpret_cast(&request->remote_ip) [0]); + + const char* requestUri = request->uri; + #elif ORTHANC_ENABLE_CIVETWEB == 1 const char* remoteIp = request->remote_addr; + const char* requestUri = request->local_uri; #else #error #endif + if (requestUri == NULL) + { + requestUri = ""; + } + std::string username = GetAuthenticatedUsername(headers); IIncomingHttpRequestFilter *filter = server.GetIncomingHttpRequestFilter(); if (filter != NULL) { - if (!filter->IsAllowed(method, request->uri, remoteIp, + if (!filter->IsAllowed(method, requestUri, remoteIp, username.c_str(), headers, argumentsGET)) { //output.SendUnauthorized(server.GetRealm()); @@ -744,7 +753,7 @@ UriComponents uri; try { - Toolbox::SplitUriComponents(uri, request->uri); + Toolbox::SplitUriComponents(uri, requestUri); } catch (OrthancException&) { @@ -775,16 +784,21 @@ { try { - void* that = NULL; - #if ORTHANC_ENABLE_MONGOOSE == 1 - that = request->user_data; + void *that = request->user_data; + const char* requestUri = request->uri; #elif ORTHANC_ENABLE_CIVETWEB == 1 // https://github.com/civetweb/civetweb/issues/409 - that = mg_get_user_data(mg_get_context(connection)); + void *that = mg_get_user_data(mg_get_context(connection)); + const char* requestUri = request->local_uri; #else #error -#endif +#endif + + if (requestUri == NULL) + { + requestUri = ""; + } MongooseServer* server = reinterpret_cast(that); @@ -846,7 +860,7 @@ } else { - server->GetExceptionFormatter()->Format(output, e, method, request->uri); + server->GetExceptionFormatter()->Format(output, e, method, requestUri); } } catch (OrthancException&) diff -r b89a4288d605 -r ad37c21ec4db NEWS --- a/NEWS Wed Dec 26 11:15:17 2018 +0100 +++ b/NEWS Sat Dec 29 14:16:43 2018 +0100 @@ -5,8 +5,10 @@ ----------- * Fix issue #118 (Wording in Configuration.json regarding SynchronousCMove) -* Fixed Orthanc Explorer on IE and Firefox: Explorer always show "to many results" +* Fixed Orthanc Explorer on IE and Firefox: Explorer always show "too many results" and it's therefore impossible to browse the content. +* Upgraded dependencies for static and Windows builds: + - civetweb 1.11 Version 1.5.1 (2018-12-20) diff -r b89a4288d605 -r ad37c21ec4db Resources/CMake/CivetwebConfiguration.cmake --- a/Resources/CMake/CivetwebConfiguration.cmake Wed Dec 26 11:15:17 2018 +0100 +++ b/Resources/CMake/CivetwebConfiguration.cmake Sat Dec 29 14:16:43 2018 +0100 @@ -1,7 +1,7 @@ if (STATIC_BUILD OR NOT USE_SYSTEM_CIVETWEB) - set(CIVETWEB_SOURCES_DIR ${CMAKE_BINARY_DIR}/civetweb-1.9.1) - set(CIVETWEB_URL "http://www.orthanc-server.com/downloads/third-party/civetweb-1.9.1.tar.gz") - set(CIVETWEB_MD5 "c713f7336582d1a78897971260c67c2a") + set(CIVETWEB_SOURCES_DIR ${CMAKE_BINARY_DIR}/civetweb-1.11) + set(CIVETWEB_URL "http://www.orthanc-server.com/downloads/third-party/civetweb-1.11.tar.gz") + set(CIVETWEB_MD5 "b6d2175650a27924bccb747cbe084cd4") DownloadPackage(${CIVETWEB_MD5} ${CIVETWEB_URL} "${CIVETWEB_SOURCES_DIR}") diff -r b89a4288d605 -r ad37c21ec4db UnitTestsSources/VersionsTests.cpp --- a/UnitTestsSources/VersionsTests.cpp Wed Dec 26 11:15:17 2018 +0100 +++ b/UnitTestsSources/VersionsTests.cpp Sat Dec 29 14:16:43 2018 +0100 @@ -47,7 +47,11 @@ #include #if ORTHANC_ENABLE_SSL == 1 -#include +# include +#endif + +#if ORTHANC_ENABLE_CIVETWEB == 1 +# include #endif @@ -173,4 +177,17 @@ #endif } + +#if ORTHANC_ENABLE_CIVETWEB == 1 +TEST(Version, Civetweb) +{ + ASSERT_EQ(1, CIVETWEB_VERSION_MAJOR); + ASSERT_EQ(11, CIVETWEB_VERSION_MINOR); + ASSERT_EQ(0, CIVETWEB_VERSION_PATCH); +} #endif + + +#endif + +