comparison Core/HttpServer/IHttpHandler.h @ 3395:0ce9b4f5fdf5

new abstraction: IHttpHandler::CreateStreamHandler()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 06 Jun 2019 18:54:27 +0200
parents 4e43e67f8ecf
children 962e5f00744b
comparison
equal deleted inserted replaced
3394:2f82ef41bf5a 3395:0ce9b4f5fdf5
47 { 47 {
48 public: 48 public:
49 typedef std::map<std::string, std::string> Arguments; 49 typedef std::map<std::string, std::string> Arguments;
50 typedef std::vector< std::pair<std::string, std::string> > GetArguments; 50 typedef std::vector< std::pair<std::string, std::string> > GetArguments;
51 51
52
53 class IStream : public boost::noncopyable
54 {
55 public:
56 virtual ~IStream()
57 {
58 }
59
60 virtual void AddBodyChunk(const void* data,
61 size_t size) = 0;
62
63 virtual void Execute(HttpOutput& output) = 0;
64 };
65
66
52 virtual ~IHttpHandler() 67 virtual ~IHttpHandler()
53 { 68 {
54 } 69 }
70
71 // This function is called for each incomding POST/PUT request
72 // (new in Orthanc 1.5.7). It allows to deal with chunked transfers.
73 virtual IStream* CreateStreamHandler(RequestOrigin origin,
74 const char* remoteIp,
75 const char* username,
76 HttpMethod method,
77 const UriComponents& uri,
78 const Arguments& headers) = 0;
55 79
56 virtual bool Handle(HttpOutput& output, 80 virtual bool Handle(HttpOutput& output,
57 RequestOrigin origin, 81 RequestOrigin origin,
58 const char* remoteIp, 82 const char* remoteIp,
59 const char* username, 83 const char* username,