diff Framework/TransferToolbox.cpp @ 44:f4e828607f02

Added 'SenderTransferID' option that is added as an HTTP header in outgoing requests in PushMode
author Alain Mazy <am@osimis.io>
date Wed, 19 Oct 2022 21:12:57 +0200
parents 44a0430d7899
children 1e396fb509ca
line wrap: on
line diff
--- a/Framework/TransferToolbox.cpp	Tue Jul 12 17:49:40 2022 +0200
+++ b/Framework/TransferToolbox.cpp	Wed Oct 19 21:12:57 2022 +0200
@@ -83,7 +83,9 @@
                   size_t peerIndex,
                   const std::string& uri,
                   const std::string& body,
-                  unsigned int maxRetries)
+                  unsigned int maxRetries,
+                  const std::map<std::string, std::string>& headers
+)
   {
     unsigned int retry = 0;
 
@@ -91,7 +93,7 @@
     {
       try
       {
-        if (peers.DoPost(answer, peerIndex, uri, body))
+        if (peers.DoPost(answer, peerIndex, uri, body, headers))
         {
           return true;
         }
@@ -119,19 +121,21 @@
                   const std::string& peerName,
                   const std::string& uri,
                   const std::string& body,
-                  unsigned int maxRetries)
+                  unsigned int maxRetries,
+                  const std::map<std::string, std::string>& headers)
   {
     size_t index;
 
     return (peers.LookupName(index, peerName) &&
-            DoPostPeer(answer, peers, index, uri, body, maxRetries));
+            DoPostPeer(answer, peers, index, uri, body, maxRetries, headers));
   }
 
 
   bool DoDeletePeer(const OrthancPeers& peers,
                     size_t peerIndex,
                     const std::string& uri,
-                    unsigned int maxRetries)
+                    unsigned int maxRetries,
+                    const std::map<std::string, std::string>& headers)
   {
     unsigned int retry = 0;
 
@@ -139,7 +143,7 @@
     {
       try
       {
-        if (peers.DoDelete(peerIndex, uri))
+        if (peers.DoDelete(peerIndex, uri, headers))
         {
           return true;
         }