# HG changeset patch # User Alain Mazy # Date 1773865409 -3600 # Node ID a760a8b2c64c508493bf4d2b57788f3dd9ebf032 # Parent b4f6c00c343f334961e24f8fc8be490ed2c3f9c0 DicomWebStowClient: populate Content.Resources and Content.Server fields at creation diff -r b4f6c00c343f -r a760a8b2c64c CMakeLists.txt --- a/CMakeLists.txt Fri Mar 13 18:02:12 2026 +0100 +++ b/CMakeLists.txt Wed Mar 18 21:23:29 2026 +0100 @@ -29,7 +29,7 @@ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "e0979326ac53") # while waiting for 1.12.11 + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "71400f1c6143") # while waiting for 1.12.11 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() diff -r b4f6c00c343f -r a760a8b2c64c NEWS --- a/NEWS Fri Mar 13 18:02:12 2026 +0100 +++ b/NEWS Wed Mar 18 21:23:29 2026 +0100 @@ -11,6 +11,8 @@ - orthanc_dicomweb_wadors_total_bytes_transferred counts the number of bytes that have been returned by any WADO-RS route to retrieve instances, series or studies. This is updated while the response is returned. +* "DicomWebStowClient" jobs now have their "Content.Resources" and "Content.Server" fields populated + as soon as they are created and not only when they start being executed. Version 1.22 (2025-12-02) diff -r b4f6c00c343f -r a760a8b2c64c Plugin/DicomWebClient.cpp --- a/Plugin/DicomWebClient.cpp Fri Mar 13 18:02:12 2026 +0100 +++ b/Plugin/DicomWebClient.cpp Wed Mar 18 21:23:29 2026 +0100 @@ -168,14 +168,7 @@ } } - // void SetContent(const std::string& key, - // const std::string& value) - // { - // boost::mutex::scoped_lock lock(mutex_); - // content_[key] = value; - // UpdateContent(content_); - // } - +protected: void SetContent(const std::string& key, const Json::Value& value) { @@ -184,6 +177,7 @@ UpdateContent(content_); } +private: static void Worker(SingleFunctionJob* job, IFunctionFactory* factory) { @@ -594,7 +588,6 @@ Action action_; size_t networkSize_; bool debug_; - Json::Value resourcesForJobContent_; bool ReadNextInstance(std::string& dicom, JobContext& context) @@ -713,8 +706,6 @@ { boost::mutex::scoped_lock lock(that_.mutex_); context.SetContent("InstancesCount", boost::lexical_cast(that_.instances_.size())); - context.SetContent("Resources", that_.GetResourcesForJobContent()); - context.SetContent("Server", that_.GetServerName()); serverName = that_.serverName_; startPosition = that_.position_; @@ -817,9 +808,11 @@ position_(0), action_(Action_None), networkSize_(0), - debug_(false), - resourcesForJobContent_(resourcesForJobContent) + debug_(false) { + SetContent("Resources", resourcesForJobContent); + SetContent("Server", serverName_); + SetFactory(*this); instances_.reserve(instances.size()); @@ -855,15 +848,6 @@ debug_ = debug; } - const Json::Value& GetResourcesForJobContent() - { - return resourcesForJobContent_; - } - - const std::string& GetServerName() - { - return serverName_; - } };