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