comparison OrthancServer/ServerContext.cpp @ 1525:f9b0169eb6bb

testing
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 11 Aug 2015 17:50:38 +0200
parents c388502a066d
children e9325f3ac496
comparison
equal deleted inserted replaced
1524:4a0c2eedceb6 1525:f9b0169eb6bb
32 32
33 #include "PrecompiledHeadersServer.h" 33 #include "PrecompiledHeadersServer.h"
34 #include "ServerContext.h" 34 #include "ServerContext.h"
35 35
36 #include "../Core/HttpServer/FilesystemHttpSender.h" 36 #include "../Core/HttpServer/FilesystemHttpSender.h"
37 #include "../Core/HttpServer/HttpStreamTranscoder.h"
37 #include "../Core/Logging.h" 38 #include "../Core/Logging.h"
38 #include "FromDcmtkBridge.h" 39 #include "FromDcmtkBridge.h"
39 #include "ServerToolbox.h" 40 #include "ServerToolbox.h"
40 #include "OrthancInitialization.h" 41 #include "OrthancInitialization.h"
41 42
316 #if 1 317 #if 1
317 accessor_.SetCompressionForNextOperations(attachment.GetCompressionType()); 318 accessor_.SetCompressionForNextOperations(attachment.GetCompressionType());
318 319
319 std::auto_ptr<HttpFileSender> sender(accessor_.ConstructHttpFileSender(attachment.GetUuid(), attachment.GetContentType())); 320 std::auto_ptr<HttpFileSender> sender(accessor_.ConstructHttpFileSender(attachment.GetUuid(), attachment.GetContentType()));
320 sender->SetContentType(GetMimeType(content)); 321 sender->SetContentType(GetMimeType(content));
321 sender->SetContentFilename(instancePublicId + ".dcm"); // TODO ".dcm" => ToMimeType(content) 322 sender->SetContentFilename(attachment.GetUuid() + ".dcm"); // TODO ".dcm" => ToMimeType(content)
322 output.AnswerStream(*sender); 323 output.AnswerStream(*sender);
323 #else 324 #else
324 const FilesystemStorage& a = dynamic_cast<FilesystemStorage&>(accessor_.GetStorageArea()); 325 const FilesystemStorage& a = dynamic_cast<FilesystemStorage&>(accessor_.GetStorageArea());
325 326
326 FilesystemHttpSender sender(a, attachment.GetUuid()); 327 FilesystemHttpSender sender(a, attachment.GetUuid());
327 sender.SetSourceCompression(attachment.GetCompressionType());
328 sender.SetContentType(GetMimeType(content)); 328 sender.SetContentType(GetMimeType(content));
329 sender.SetContentFilename(instancePublicId + ".dcm"); 329 sender.SetContentFilename(attachment.GetUuid() + ".dcm");
330 output.AnswerStream(sender); 330
331 HttpStreamTranscoder transcoder(sender, attachment.GetCompressionType());
332 output.AnswerStream(transcoder);
331 #endif 333 #endif
332 } 334 }
333 335
334 336
335 void ServerContext::ReadJson(Json::Value& result, 337 void ServerContext::ReadJson(Json::Value& result,