comparison OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp @ 4451:f4dbdb2dcba6

new configuration option "MaximumPduLength" to tune the maximum PDU length
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 18 Jan 2021 14:51:52 +0100
parents d9473bd5ed43
children 9c070a34de18
comparison
equal deleted inserted replaced
4450:9bf2f9e0af47 4451:f4dbdb2dcba6
253 253
254 254
255 255
256 CommandDispatcher* AcceptAssociation(const DicomServer& server, 256 CommandDispatcher* AcceptAssociation(const DicomServer& server,
257 T_ASC_Network *net, 257 T_ASC_Network *net,
258 unsigned int maximumPduLength,
258 bool useDicomTls) 259 bool useDicomTls)
259 { 260 {
260 DcmAssociationConfiguration asccfg; 261 DcmAssociationConfiguration asccfg;
261 char buf[BUFSIZ]; 262 char buf[BUFSIZ];
262 T_ASC_Association *assoc; 263 T_ASC_Association *assoc;
263 OFCondition cond; 264 OFCondition cond;
264 OFString sprofile; 265 OFString sprofile;
265 OFString temp_str; 266 OFString temp_str;
266 267
267 cond = ASC_receiveAssociation(net, &assoc, 268 cond = ASC_receiveAssociation(net, &assoc, maximumPduLength, NULL, NULL,
268 /*opt_maxPDU*/ ASC_DEFAULTMAXPDU,
269 NULL, NULL,
270 useDicomTls /*opt_secureConnection*/, 269 useDicomTls /*opt_secureConnection*/,
271 DUL_NOBLOCK, 1); 270 DUL_NOBLOCK, 1);
272 271
273 if (cond == DUL_NOASSOCIATIONREQUEST) 272 if (cond == DUL_NOASSOCIATIONREQUEST)
274 { 273 {
692 << ASC_dumpParameters(str, assoc->params, ASC_ASSOC_AC); 691 << ASC_dumpParameters(str, assoc->params, ASC_ASSOC_AC);
693 } 692 }
694 } 693 }
695 694
696 IApplicationEntityFilter* filter = server.HasApplicationEntityFilter() ? &server.GetApplicationEntityFilter() : NULL; 695 IApplicationEntityFilter* filter = server.HasApplicationEntityFilter() ? &server.GetApplicationEntityFilter() : NULL;
697 return new CommandDispatcher(server, assoc, remoteIp, remoteAet, calledAet, filter); 696 return new CommandDispatcher(server, assoc, remoteIp, remoteAet, calledAet, maximumPduLength, filter);
698 } 697 }
699 698
700 699
701 CommandDispatcher::CommandDispatcher(const DicomServer& server, 700 CommandDispatcher::CommandDispatcher(const DicomServer& server,
702 T_ASC_Association* assoc, 701 T_ASC_Association* assoc,
703 const std::string& remoteIp, 702 const std::string& remoteIp,
704 const std::string& remoteAet, 703 const std::string& remoteAet,
705 const std::string& calledAet, 704 const std::string& calledAet,
705 unsigned int maximumPduLength,
706 IApplicationEntityFilter* filter) : 706 IApplicationEntityFilter* filter) :
707 server_(server), 707 server_(server),
708 assoc_(assoc), 708 assoc_(assoc),
709 remoteIp_(remoteIp), 709 remoteIp_(remoteIp),
710 remoteAet_(remoteAet), 710 remoteAet_(remoteAet),