Mercurial > hg > orthanc
changeset 3070:1bc4a1bb66e9 db-changes
integration mainline->db-changes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 02 Jan 2019 10:13:11 +0100 |
parents | c3d2f24dda87 (current diff) 3db9697a0a58 (diff) |
children | 2df061cf2fec |
files | |
diffstat | 5 files changed, 77 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/HttpServer/MongooseServer.cpp Mon Dec 24 11:41:45 2018 +0100 +++ b/Core/HttpServer/MongooseServer.cpp Wed Jan 02 10:13:11 2019 +0100 @@ -42,10 +42,10 @@ #include "HttpToolbox.h" #if ORTHANC_ENABLE_MONGOOSE == 1 -# include "mongoose.h" +# include <mongoose.h> #elif ORTHANC_ENABLE_CIVETWEB == 1 -# include "civetweb.h" +# include <civetweb.h> # define MONGOOSE_USE_CALLBACKS 1 #else @@ -605,7 +605,7 @@ // deprecated in Civetweb, using "remote_addr" instead. localhost = (std::string(request->remote_addr) == "127.0.0.1"); #else -#error +# error #endif // Check remote calls @@ -669,18 +669,27 @@ reinterpret_cast<const uint8_t*>(&request->remote_ip) [2], reinterpret_cast<const uint8_t*>(&request->remote_ip) [1], reinterpret_cast<const uint8_t*>(&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 +# 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 +# error +#endif + + if (requestUri == NULL) + { + requestUri = ""; + } MongooseServer* server = reinterpret_cast<MongooseServer*>(that); @@ -846,7 +860,7 @@ } else { - server->GetExceptionFormatter()->Format(output, e, method, request->uri); + server->GetExceptionFormatter()->Format(output, e, method, requestUri); } } catch (OrthancException&) @@ -893,7 +907,7 @@ } #else -#error Please set MONGOOSE_USE_CALLBACKS +# error Please set MONGOOSE_USE_CALLBACKS #endif @@ -952,7 +966,7 @@ #elif ORTHANC_ENABLE_CIVETWEB == 1 LOG(INFO) << "Starting embedded Web server using Civetweb"; #else -#error +# error #endif if (!IsRunning()) @@ -997,7 +1011,7 @@ pimpl_->context_ = mg_start(&callbacks, this, options); #else -#error Please set MONGOOSE_USE_CALLBACKS +# error Please set MONGOOSE_USE_CALLBACKS #endif if (!pimpl_->context_)
--- a/NEWS Mon Dec 24 11:41:45 2018 +0100 +++ b/NEWS Wed Jan 02 10:13:11 2019 +0100 @@ -5,6 +5,10 @@ ----------- * Fix issue #118 (Wording in Configuration.json regarding SynchronousCMove) +* 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)
--- a/OrthancExplorer/explorer.js Mon Dec 24 11:41:45 2018 +0100 +++ b/OrthancExplorer/explorer.js Wed Jan 02 10:13:11 2019 +0100 @@ -1384,16 +1384,18 @@ .attr('data-role', 'list-divider') .text('General information about the job')); - let block = $('<li>'); - for (let i in job) { - if (i == 'CreationTime' || - i == 'CompletionTime' || - i == 'EstimatedTimeOfArrival') { - AddJobDateField(block, i + ': ', job[i]); - } else if (i != 'InternalContent' && - i != 'Content' && - i != 'Timestamp') { - AddJobField(block, i + ': ', job[i]); + { + let block = $('<li>'); + for (let i in job) { + if (i == 'CreationTime' || + i == 'CompletionTime' || + i == 'EstimatedTimeOfArrival') { + AddJobDateField(block, i + ': ', job[i]); + } else if (i != 'InternalContent' && + i != 'Content' && + i != 'Timestamp') { + AddJobField(block, i + ': ', job[i]); + } } } @@ -1403,17 +1405,19 @@ .attr('data-role', 'list-divider') .text('Detailed information')); - let block = $('<li>'); + { + let block = $('<li>'); - for (let item in job.Content) { - let value = job.Content[item]; - if (typeof value !== 'string') { - value = JSON.stringify(value); + for (let item in job.Content) { + let value = job.Content[item]; + if (typeof value !== 'string') { + value = JSON.stringify(value); + } + + AddJobField(block, item + ': ', value); } - - AddJobField(block, item + ': ', value); } - + target.append(block); target.listview('refresh');
--- a/Resources/CMake/CivetwebConfiguration.cmake Mon Dec 24 11:41:45 2018 +0100 +++ b/Resources/CMake/CivetwebConfiguration.cmake Wed Jan 02 10:13:11 2019 +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}")
--- a/UnitTestsSources/VersionsTests.cpp Mon Dec 24 11:41:45 2018 +0100 +++ b/UnitTestsSources/VersionsTests.cpp Wed Jan 02 10:13:11 2019 +0100 @@ -47,7 +47,11 @@ #include <iconv.h> #if ORTHANC_ENABLE_SSL == 1 -#include <openssl/opensslv.h> +# include <openssl/opensslv.h> +#endif + +#if ORTHANC_ENABLE_CIVETWEB == 1 +# include <civetweb.h> #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 + +