Mercurial > hg > orthanc
annotate OrthancServer/DicomProtocol/DicomServer.cpp @ 2212:c02f6ec404d8
OrthancPlugins::FindMatcher
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 10 Dec 2016 10:05:16 +0100 |
parents | 5a8840920121 |
children | a3a65de1840f |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1243
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
0 | 5 * |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
136 | 10 * |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
0 | 22 * |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
831
84513f2ee1f3
pch for unit tests and server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
33 #include "../PrecompiledHeadersServer.h" |
0 | 34 #include "DicomServer.h" |
35 | |
1486
f967bdf8534e
refactoring to Logging.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1454
diff
changeset
|
36 #include "../../Core/Logging.h" |
62 | 37 #include "../../Core/OrthancException.h" |
0 | 38 #include "../../Core/Toolbox.h" |
39 #include "../Internals/CommandDispatcher.h" | |
690
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
40 #include "../OrthancInitialization.h" |
291
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
137
diff
changeset
|
41 #include "EmbeddedResources.h" |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
42 #include "../../Core/MultiThreading/RunnableWorkersPool.h" |
0 | 43 |
44 #include <boost/thread.hpp> | |
45 | |
1976
325772dadcd6
Macro "__linux" (now obsolete) replaced by macro "__linux__"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
46 #if defined(__linux__) |
376
2cef9c2d4148
separate path for SQLite index, manual loading of external dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
357
diff
changeset
|
47 #include <cstdlib> |
2cef9c2d4148
separate path for SQLite index, manual loading of external dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
357
diff
changeset
|
48 #endif |
2cef9c2d4148
separate path for SQLite index, manual loading of external dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
357
diff
changeset
|
49 |
0 | 50 |
62 | 51 namespace Orthanc |
0 | 52 { |
53 struct DicomServer::PImpl | |
54 { | |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
55 boost::thread thread_; |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
56 T_ASC_Network *network_; |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
57 std::auto_ptr<RunnableWorkersPool> workers_; |
0 | 58 }; |
59 | |
60 | |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
61 void DicomServer::ServerThread(DicomServer* server) |
685
b01cc78caba4
possibility to disable the DICOM/HTTP servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
660
diff
changeset
|
62 { |
137
0e97abc7b950
fix of a bug in older versions of sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
63 LOG(INFO) << "DICOM server started"; |
0 | 64 |
65 while (server->continue_) | |
66 { | |
67 /* receive an association and acknowledge or reject it. If the association was */ | |
68 /* acknowledged, offer corresponding services and invoke one or more if required. */ | |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
69 std::auto_ptr<Internals::CommandDispatcher> dispatcher(Internals::AcceptAssociation(*server, server->pimpl_->network_)); |
0 | 70 |
1680 | 71 try |
0 | 72 { |
1680 | 73 if (dispatcher.get() != NULL) |
0 | 74 { |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
75 server->pimpl_->workers_->Add(dispatcher.release()); |
0 | 76 } |
1680 | 77 } |
78 catch (OrthancException& e) | |
79 { | |
80 LOG(ERROR) << "Exception in the DICOM server thread: " << e.What(); | |
0 | 81 } |
82 } | |
83 | |
137
0e97abc7b950
fix of a bug in older versions of sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
84 LOG(INFO) << "DICOM server stopping"; |
1680 | 85 } |
0 | 86 |
87 | |
656 | 88 DicomServer::DicomServer() : |
89 pimpl_(new PImpl), | |
90 aet_("ANY-SCP") | |
0 | 91 { |
92 port_ = 104; | |
93 findRequestHandlerFactory_ = NULL; | |
94 moveRequestHandlerFactory_ = NULL; | |
95 storeRequestHandlerFactory_ = NULL; | |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
96 worklistRequestHandlerFactory_ = NULL; |
0 | 97 applicationEntityFilter_ = NULL; |
98 checkCalledAet_ = true; | |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1976
diff
changeset
|
99 associationTimeout_ = 30; |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
100 continue_ = false; |
0 | 101 } |
102 | |
103 DicomServer::~DicomServer() | |
104 { | |
1453
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
105 if (continue_) |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
106 { |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
107 LOG(ERROR) << "INTERNAL ERROR: DicomServer::Stop() should be invoked manually to avoid mess in the destruction order!"; |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
108 Stop(); |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
109 } |
0 | 110 } |
111 | |
128 | 112 void DicomServer::SetPortNumber(uint16_t port) |
0 | 113 { |
114 Stop(); | |
115 port_ = port; | |
116 } | |
117 | |
128 | 118 uint16_t DicomServer::GetPortNumber() const |
0 | 119 { |
120 return port_; | |
121 } | |
122 | |
2069
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
123 void DicomServer::SetAssociationTimeout(uint32_t seconds) |
0 | 124 { |
2069
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
125 LOG(INFO) << "Setting timeout for DICOM connections if Orthanc acts as SCP (server): " |
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
126 << seconds << " seconds (0 = no timeout)"; |
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
127 |
0 | 128 Stop(); |
2069
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
129 associationTimeout_ = seconds; |
0 | 130 } |
131 | |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1976
diff
changeset
|
132 uint32_t DicomServer::GetAssociationTimeout() const |
0 | 133 { |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1976
diff
changeset
|
134 return associationTimeout_; |
0 | 135 } |
136 | |
137 | |
138 void DicomServer::SetCalledApplicationEntityTitleCheck(bool check) | |
139 { | |
140 Stop(); | |
141 checkCalledAet_ = check; | |
142 } | |
143 | |
144 bool DicomServer::HasCalledApplicationEntityTitleCheck() const | |
145 { | |
146 return checkCalledAet_; | |
147 } | |
148 | |
149 void DicomServer::SetApplicationEntityTitle(const std::string& aet) | |
150 { | |
151 if (aet.size() == 0) | |
152 { | |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1486
diff
changeset
|
153 throw OrthancException(ErrorCode_BadApplicationEntityTitle); |
0 | 154 } |
155 | |
1234 | 156 if (aet.size() > 16) |
157 { | |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1486
diff
changeset
|
158 throw OrthancException(ErrorCode_BadApplicationEntityTitle); |
1234 | 159 } |
160 | |
0 | 161 for (size_t i = 0; i < aet.size(); i++) |
162 { | |
1243 | 163 if (!(aet[i] == '-' || |
164 aet[i] == '_' || | |
165 isdigit(aet[i]) || | |
166 (aet[i] >= 'A' && aet[i] <= 'Z'))) | |
0 | 167 { |
1234 | 168 LOG(WARNING) << "For best interoperability, only upper case, alphanumeric characters should be present in AET: \"" << aet << "\""; |
169 break; | |
0 | 170 } |
171 } | |
172 | |
173 Stop(); | |
174 aet_ = aet; | |
175 } | |
176 | |
177 const std::string& DicomServer::GetApplicationEntityTitle() const | |
178 { | |
179 return aet_; | |
180 } | |
181 | |
182 void DicomServer::SetFindRequestHandlerFactory(IFindRequestHandlerFactory& factory) | |
183 { | |
184 Stop(); | |
185 findRequestHandlerFactory_ = &factory; | |
186 } | |
187 | |
188 bool DicomServer::HasFindRequestHandlerFactory() const | |
189 { | |
190 return (findRequestHandlerFactory_ != NULL); | |
191 } | |
192 | |
193 IFindRequestHandlerFactory& DicomServer::GetFindRequestHandlerFactory() const | |
194 { | |
195 if (HasFindRequestHandlerFactory()) | |
196 { | |
197 return *findRequestHandlerFactory_; | |
198 } | |
199 else | |
200 { | |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1486
diff
changeset
|
201 throw OrthancException(ErrorCode_NoCFindHandler); |
0 | 202 } |
203 } | |
204 | |
205 void DicomServer::SetMoveRequestHandlerFactory(IMoveRequestHandlerFactory& factory) | |
206 { | |
207 Stop(); | |
208 moveRequestHandlerFactory_ = &factory; | |
209 } | |
210 | |
211 bool DicomServer::HasMoveRequestHandlerFactory() const | |
212 { | |
213 return (moveRequestHandlerFactory_ != NULL); | |
214 } | |
215 | |
216 IMoveRequestHandlerFactory& DicomServer::GetMoveRequestHandlerFactory() const | |
217 { | |
218 if (HasMoveRequestHandlerFactory()) | |
219 { | |
220 return *moveRequestHandlerFactory_; | |
221 } | |
222 else | |
223 { | |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1486
diff
changeset
|
224 throw OrthancException(ErrorCode_NoCMoveHandler); |
0 | 225 } |
226 } | |
227 | |
228 void DicomServer::SetStoreRequestHandlerFactory(IStoreRequestHandlerFactory& factory) | |
229 { | |
230 Stop(); | |
231 storeRequestHandlerFactory_ = &factory; | |
232 } | |
233 | |
234 bool DicomServer::HasStoreRequestHandlerFactory() const | |
235 { | |
236 return (storeRequestHandlerFactory_ != NULL); | |
237 } | |
238 | |
239 IStoreRequestHandlerFactory& DicomServer::GetStoreRequestHandlerFactory() const | |
240 { | |
241 if (HasStoreRequestHandlerFactory()) | |
242 { | |
243 return *storeRequestHandlerFactory_; | |
244 } | |
245 else | |
246 { | |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1486
diff
changeset
|
247 throw OrthancException(ErrorCode_NoCStoreHandler); |
0 | 248 } |
249 } | |
250 | |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
251 void DicomServer::SetWorklistRequestHandlerFactory(IWorklistRequestHandlerFactory& factory) |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
252 { |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
253 Stop(); |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
254 worklistRequestHandlerFactory_ = &factory; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
255 } |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
256 |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
257 bool DicomServer::HasWorklistRequestHandlerFactory() const |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
258 { |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
259 return (worklistRequestHandlerFactory_ != NULL); |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
260 } |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
261 |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
262 IWorklistRequestHandlerFactory& DicomServer::GetWorklistRequestHandlerFactory() const |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
263 { |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
264 if (HasWorklistRequestHandlerFactory()) |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
265 { |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
266 return *worklistRequestHandlerFactory_; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
267 } |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
268 else |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
269 { |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
270 throw OrthancException(ErrorCode_NoWorklistHandler); |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
271 } |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
272 } |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
273 |
0 | 274 void DicomServer::SetApplicationEntityFilter(IApplicationEntityFilter& factory) |
275 { | |
276 Stop(); | |
277 applicationEntityFilter_ = &factory; | |
278 } | |
279 | |
280 bool DicomServer::HasApplicationEntityFilter() const | |
281 { | |
282 return (applicationEntityFilter_ != NULL); | |
283 } | |
284 | |
285 IApplicationEntityFilter& DicomServer::GetApplicationEntityFilter() const | |
286 { | |
287 if (HasApplicationEntityFilter()) | |
288 { | |
289 return *applicationEntityFilter_; | |
290 } | |
291 else | |
292 { | |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1486
diff
changeset
|
293 throw OrthancException(ErrorCode_NoApplicationEntityFilter); |
0 | 294 } |
295 } | |
296 | |
297 void DicomServer::Start() | |
298 { | |
299 Stop(); | |
300 | |
1680 | 301 /* initialize network, i.e. create an instance of T_ASC_Network*. */ |
302 OFCondition cond = ASC_initializeNetwork | |
2069
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
303 (NET_ACCEPTOR, OFstatic_cast(int, port_), /*opt_acse_timeout*/ 30, &pimpl_->network_); |
1680 | 304 if (cond.bad()) |
0 | 305 { |
1680 | 306 LOG(ERROR) << "cannot create network: " << cond.text(); |
307 throw OrthancException(ErrorCode_DicomPortInUse); | |
0 | 308 } |
1680 | 309 |
1675
131136aeeaa7
improved exception handling in the main program
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
310 continue_ = true; |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
311 pimpl_->workers_.reset(new RunnableWorkersPool(4)); // Use 4 workers - TODO as a parameter? |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
312 pimpl_->thread_ = boost::thread(ServerThread, this); |
0 | 313 } |
314 | |
1453
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
315 |
0 | 316 void DicomServer::Stop() |
317 { | |
1453
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
318 if (continue_) |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
319 { |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
320 continue_ = false; |
431
16b52fb8d034
fix by cyril paulus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
321 |
1453
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
322 if (pimpl_->thread_.joinable()) |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
323 { |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
324 pimpl_->thread_.join(); |
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
325 } |
1454 | 326 |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
327 pimpl_->workers_.reset(NULL); |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
328 |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
329 /* drop the network, i.e. free memory of T_ASC_Network* structure. This call */ |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
330 /* is the counterpart of ASC_initializeNetwork(...) which was called above. */ |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
331 OFCondition cond = ASC_dropNetwork(&pimpl_->network_); |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
332 if (cond.bad()) |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
333 { |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
334 LOG(ERROR) << "Error while dropping the network: " << cond.text(); |
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1680
diff
changeset
|
335 } |
431
16b52fb8d034
fix by cyril paulus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
336 } |
0 | 337 } |
690
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
338 |
1453
c0bdc47165ef
code to warn about possible threading problems
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
339 |
690
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
340 bool DicomServer::IsMyAETitle(const std::string& aet) const |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
341 { |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
342 if (!HasCalledApplicationEntityTitleCheck()) |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
343 { |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
344 // OK, no check on the AET. |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
345 return true; |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
346 } |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
347 |
810
401a9633e492
configuration into a namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
348 return Configuration::IsSameAETitle(aet, GetApplicationEntityTitle()); |
690
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
349 } |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
350 |
0 | 351 } |