Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
1572:904096e7367e | 1573:3309878b3e16 |
---|---|
188 throw OrthancException(ErrorCode_BadSequenceOfCalls); | 188 throw OrthancException(ErrorCode_BadSequenceOfCalls); |
189 } | 189 } |
190 | 190 |
191 case RequestOrigin_DicomProtocol: | 191 case RequestOrigin_DicomProtocol: |
192 { | 192 { |
193 result["RemoteIp"] = remoteIp_; | |
193 result["RemoteAet"] = dicomRemoteAet_; | 194 result["RemoteAet"] = dicomRemoteAet_; |
194 result["CalledAet"] = dicomCalledAet_; | 195 result["CalledAet"] = dicomCalledAet_; |
195 break; | 196 break; |
196 } | 197 } |
197 | 198 |
198 case RequestOrigin_Http: | 199 case RequestOrigin_Http: |
199 { | 200 { |
200 result["RemoteIp"] = httpRemoteIp_; | 201 result["RemoteIp"] = remoteIp_; |
201 result["Username"] = httpUsername_; | 202 result["Username"] = httpUsername_; |
202 break; | 203 break; |
203 } | 204 } |
204 | 205 |
205 case RequestOrigin_Lua: | 206 case RequestOrigin_Lua: |
213 throw OrthancException(ErrorCode_InternalError); | 214 throw OrthancException(ErrorCode_InternalError); |
214 } | 215 } |
215 } | 216 } |
216 | 217 |
217 | 218 |
218 void DicomInstanceToStore::SetDicomProtocolOrigin(const char* remoteAet, | 219 void DicomInstanceToStore::SetDicomProtocolOrigin(const char* remoteIp, |
220 const char* remoteAet, | |
219 const char* calledAet) | 221 const char* calledAet) |
220 { | 222 { |
221 origin_ = RequestOrigin_DicomProtocol; | 223 origin_ = RequestOrigin_DicomProtocol; |
224 remoteIp_ = remoteIp; | |
222 dicomRemoteAet_ = remoteAet; | 225 dicomRemoteAet_ = remoteAet; |
223 dicomCalledAet_ = calledAet; | 226 dicomCalledAet_ = calledAet; |
224 } | 227 } |
225 | 228 |
226 void DicomInstanceToStore::SetRestOrigin(const RestApiCall& call) | 229 void DicomInstanceToStore::SetRestOrigin(const RestApiCall& call) |
227 { | 230 { |
228 origin_ = call.GetRequestOrigin(); | 231 origin_ = call.GetRequestOrigin(); |
229 | 232 |
230 if (origin_ == RequestOrigin_Http) | 233 if (origin_ == RequestOrigin_Http) |
231 { | 234 { |
232 httpRemoteIp_ = call.GetRemoteIp(); | 235 remoteIp_ = call.GetRemoteIp(); |
233 httpUsername_ = call.GetUsername(); | 236 httpUsername_ = call.GetUsername(); |
234 } | 237 } |
235 } | 238 } |
236 | 239 |
237 void DicomInstanceToStore::SetHttpOrigin(const char* remoteIp, | 240 void DicomInstanceToStore::SetHttpOrigin(const char* remoteIp, |
238 const char* username) | 241 const char* username) |
239 { | 242 { |
240 origin_ = RequestOrigin_Http; | 243 origin_ = RequestOrigin_Http; |
241 httpRemoteIp_ = remoteIp; | 244 remoteIp_ = remoteIp; |
242 httpUsername_ = username; | 245 httpUsername_ = username; |
243 } | 246 } |
244 | 247 |
245 void DicomInstanceToStore::SetLuaOrigin() | 248 void DicomInstanceToStore::SetLuaOrigin() |
246 { | 249 { |