changeset 6324:e937476ccfff

upgraded to civetweb 1.16
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 23 Sep 2025 15:50:33 +0200
parents d2b63ea23719
children a80c704e8594
files .hgignore NEWS OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake OrthancFramework/Resources/Patches/civetweb-1.16.patch
diffstat 4 files changed, 49 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Tue Sep 23 12:03:51 2025 +0200
+++ b/.hgignore	Tue Sep 23 15:50:33 2025 +0200
@@ -3,6 +3,7 @@
 CMakeLists.txt.user
 *.cpp.orig
 *.h.orig
+*.patch.orig
 .vs/
 .vscode/
 *~
--- a/NEWS	Tue Sep 23 12:03:51 2025 +0200
+++ b/NEWS	Tue Sep 23 15:50:33 2025 +0200
@@ -39,6 +39,8 @@
        empty element in a sequence.  This was preventing access to /dicom-web/../metadata routes and prevented
        visualization in e.g. the Stone Web viewer and OHIF.
 * Fix issue 252: Disallow colons in HTTP basic usernames
+* Upgraded dependencies for static builds:
+  - civetweb 1.16
 
 
 Version 1.12.9 (2025-08-11)
--- a/OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake	Tue Sep 23 12:03:51 2025 +0200
+++ b/OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake	Tue Sep 23 15:50:33 2025 +0200
@@ -22,21 +22,21 @@
 
 if (STATIC_BUILD OR NOT USE_SYSTEM_CIVETWEB)
 
-  ## WARNING: "civetweb-1.14.tar.gz" comes with a subfolder
-  ## "civetweb-1.14/test/nonlatin" that cannot be removed by "hg purge
+  ## WARNING: "civetweb-1.16.tar.gz" comes with a subfolder
+  ## "civetweb-1.16/test/nonlatin" that cannot be removed by "hg purge
   ## --all" on Windows hosts. We thus created a custom
-  ## "civetweb-1.14-fixed.tar.gz" as follows:
+  ## "civetweb-1.16-fixed.tar.gz" as follows:
   ##
   ##  $ cd /tmp
-  ##  $ wget https://orthanc.uclouvain.be/downloads/third-party-downloads/civetweb-1.14.tar.gz
-  ##  $ tar xvf civetweb-1.14.tar.gz
-  ##  $ rm -rf civetweb-1.14/src/third_party/ civetweb-1.14/test/
-  ##  $ tar cvfz civetweb-1.14-fixed.tar.gz civetweb-1.14
+  ##  $ wget https://orthanc.uclouvain.be/downloads/third-party-downloads/civetweb-1.16.tar.gz
+  ##  $ tar xvf civetweb-1.16.tar.gz
+  ##  $ rm -rf civetweb-1.16/src/third_party/ civetweb-1.16/test/
+  ##  $ tar cvfz civetweb-1.16-fixed.tar.gz civetweb-1.16
   ##
   
-  set(CIVETWEB_SOURCES_DIR ${CMAKE_BINARY_DIR}/civetweb-1.14)
-  set(CIVETWEB_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/civetweb-1.14-fixed.tar.gz")
-  set(CIVETWEB_MD5 "1f25d516b7a4e65d8b270d1cc399e0a9")
+  set(CIVETWEB_SOURCES_DIR ${CMAKE_BINARY_DIR}/civetweb-1.16)
+  set(CIVETWEB_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/civetweb-1.16-fixed.tar.gz")
+  set(CIVETWEB_MD5 "038edf77ea37e47def9458e8903cd53d")
 
   if (IS_DIRECTORY "${CIVETWEB_SOURCES_DIR}")
     set(FirstRun OFF)
@@ -48,7 +48,7 @@
 
   execute_process(
     COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
-    ${CMAKE_CURRENT_LIST_DIR}/../Patches/civetweb-1.14.patch
+    ${CMAKE_CURRENT_LIST_DIR}/../Patches/civetweb-1.16.patch
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     RESULT_VARIABLE Failure
     )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrthancFramework/Resources/Patches/civetweb-1.16.patch	Tue Sep 23 15:50:33 2025 +0200
@@ -0,0 +1,35 @@
+diff -urEb civetweb-1.16.orig/src/civetweb.c civetweb-1.16/src/civetweb.c
+--- civetweb-1.16.orig/src/civetweb.c	2025-09-23 15:37:44.946300709 +0200
++++ civetweb-1.16/src/civetweb.c	2025-09-23 15:38:18.426080130 +0200
+@@ -573,7 +573,7 @@
+ #if (_MSC_VER < 1300)
+ #define STRX(x) #x
+ #define STR(x) STRX(x)
+-#define __func__ __FILE__ ":" STR(__LINE__)
++#define __func__ __ORTHANC_FILE__ ":" STR(__LINE__)
+ #define strtoull(x, y, z) ((unsigned __int64)_atoi64(x))
+ #define strtoll(x, y, z) (_atoi64(x))
+ #else
+@@ -1457,14 +1457,14 @@
+ }
+ 
+ 
+-#define mg_malloc(a) mg_malloc_ex(a, NULL, __FILE__, __LINE__)
+-#define mg_calloc(a, b) mg_calloc_ex(a, b, NULL, __FILE__, __LINE__)
+-#define mg_realloc(a, b) mg_realloc_ex(a, b, NULL, __FILE__, __LINE__)
+-#define mg_free(a) mg_free_ex(a, __FILE__, __LINE__)
+-
+-#define mg_malloc_ctx(a, c) mg_malloc_ex(a, c, __FILE__, __LINE__)
+-#define mg_calloc_ctx(a, b, c) mg_calloc_ex(a, b, c, __FILE__, __LINE__)
+-#define mg_realloc_ctx(a, b, c) mg_realloc_ex(a, b, c, __FILE__, __LINE__)
++#define mg_malloc(a) mg_malloc_ex(a, NULL, __ORTHANC_FILE__, __LINE__)
++#define mg_calloc(a, b) mg_calloc_ex(a, b, NULL, __ORTHANC_FILE__, __LINE__)
++#define mg_realloc(a, b) mg_realloc_ex(a, b, NULL, __ORTHANC_FILE__, __LINE__)
++#define mg_free(a) mg_free_ex(a, __ORTHANC_FILE__, __LINE__)
++
++#define mg_malloc_ctx(a, c) mg_malloc_ex(a, c, __ORTHANC_FILE__, __LINE__)
++#define mg_calloc_ctx(a, b, c) mg_calloc_ex(a, b, c, __ORTHANC_FILE__, __LINE__)
++#define mg_realloc_ctx(a, b, c) mg_realloc_ex(a, b, c, __ORTHANC_FILE__, __LINE__)
+ 
+ 
+ #else /* USE_SERVER_STATS */