diff OrthancServer/DicomInstanceToStore.cpp @ 1573:3309878b3e16

more information about the origin of requests submitted to the DICOM handlers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 Aug 2015 13:05:22 +0200
parents 904096e7367e
children 0a2ad4a6858f
line wrap: on
line diff
--- a/OrthancServer/DicomInstanceToStore.cpp	Tue Aug 25 12:10:12 2015 +0200
+++ b/OrthancServer/DicomInstanceToStore.cpp	Tue Aug 25 13:05:22 2015 +0200
@@ -190,6 +190,7 @@
 
       case RequestOrigin_DicomProtocol:
       {
+        result["RemoteIp"] = remoteIp_;
         result["RemoteAet"] = dicomRemoteAet_;
         result["CalledAet"] = dicomCalledAet_;
         break;
@@ -197,7 +198,7 @@
 
       case RequestOrigin_Http:
       {
-        result["RemoteIp"] = httpRemoteIp_;
+        result["RemoteIp"] = remoteIp_;
         result["Username"] = httpUsername_;
         break;
       }
@@ -215,10 +216,12 @@
   }
 
 
-  void DicomInstanceToStore::SetDicomProtocolOrigin(const char* remoteAet,
+  void DicomInstanceToStore::SetDicomProtocolOrigin(const char* remoteIp,
+                                                    const char* remoteAet,
                                                     const char* calledAet)
   {
     origin_ = RequestOrigin_DicomProtocol;
+    remoteIp_ = remoteIp;
     dicomRemoteAet_ = remoteAet;
     dicomCalledAet_ = calledAet;
   }
@@ -229,7 +232,7 @@
 
     if (origin_ == RequestOrigin_Http)
     {
-      httpRemoteIp_ = call.GetRemoteIp();
+      remoteIp_ = call.GetRemoteIp();
       httpUsername_ = call.GetUsername();
     }
   }
@@ -238,7 +241,7 @@
                                            const char* username)
   {
     origin_ = RequestOrigin_Http;
-    httpRemoteIp_ = remoteIp;
+    remoteIp_ = remoteIp;
     httpUsername_ = username;
   }