Mercurial > hg > orthanc
comparison OrthancServer/DicomProtocol/DicomUserConnection.cpp @ 1684:7dae55228b16
Fix issue #4 (C-Store Association not renegotiated on Specific-to-specific transfer syntax change)
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 06 Oct 2015 16:33:17 +0200 |
parents | bd1889029cbb |
children | 9a04ad916831 |
comparison
equal
deleted
inserted
replaced
1681:ee4367497d0d | 1684:7dae55228b16 |
---|---|
270 // negotiated, depending on the transfer syntax of this instance | 270 // negotiated, depending on the transfer syntax of this instance |
271 DcmXfer xfer(dcmff.getDataset()->getOriginalXfer()); | 271 DcmXfer xfer(dcmff.getDataset()->getOriginalXfer()); |
272 const std::string syntax(xfer.getXferID()); | 272 const std::string syntax(xfer.getXferID()); |
273 bool isGeneric = IsGenericTransferSyntax(syntax); | 273 bool isGeneric = IsGenericTransferSyntax(syntax); |
274 | 274 |
275 if (isGeneric ^ IsGenericTransferSyntax(connection.GetPreferredTransferSyntax())) | 275 bool renegociate; |
276 { | 276 if (isGeneric) |
277 // Making a generic-to-specific or specific-to-generic change of | 277 { |
278 // the transfer syntax. Renegotiate the connection. | 278 // Are we making a generic-to-specific or specific-to-generic change of |
279 // the transfer syntax? If this is the case, renegotiate the connection. | |
280 renegociate = !IsGenericTransferSyntax(connection.GetPreferredTransferSyntax()); | |
281 } | |
282 else | |
283 { | |
284 // We are using a specific transfer syntax. Renegociate if the | |
285 // current connection does not match this transfer syntax. | |
286 renegociate = (syntax != connection.GetPreferredTransferSyntax()); | |
287 } | |
288 | |
289 if (renegociate) | |
290 { | |
279 LOG(INFO) << "Change in the transfer syntax: the C-Store associated must be renegotiated"; | 291 LOG(INFO) << "Change in the transfer syntax: the C-Store associated must be renegotiated"; |
280 | 292 |
281 if (isGeneric) | 293 if (isGeneric) |
282 { | 294 { |
283 connection.ResetPreferredTransferSyntax(); | 295 connection.ResetPreferredTransferSyntax(); |