Mercurial > hg > orthanc
comparison Core/HttpServer/IHttpHandler.h @ 3414:b9cba6a91780
simplification
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 11 Jun 2019 19:44:10 +0200 |
parents | 962e5f00744b |
children | 94f4a18a79cc |
comparison
equal
deleted
inserted
replaced
3413:f09bfdea3fc3 | 3414:b9cba6a91780 |
---|---|
38 | 38 |
39 #include <map> | 39 #include <map> |
40 #include <set> | 40 #include <set> |
41 #include <vector> | 41 #include <vector> |
42 #include <string> | 42 #include <string> |
43 #include <memory> | |
43 | 44 |
44 namespace Orthanc | 45 namespace Orthanc |
45 { | 46 { |
46 class IHttpHandler : public boost::noncopyable | 47 class IHttpHandler : public boost::noncopyable |
47 { | 48 { |
48 public: | 49 public: |
49 typedef std::map<std::string, std::string> Arguments; | 50 typedef std::map<std::string, std::string> Arguments; |
50 typedef std::vector< std::pair<std::string, std::string> > GetArguments; | 51 typedef std::vector< std::pair<std::string, std::string> > GetArguments; |
51 | 52 |
52 | 53 |
53 class IStream : public boost::noncopyable | 54 class IChunkedRequestReader : public boost::noncopyable |
54 { | 55 { |
55 public: | 56 public: |
56 virtual ~IStream() | 57 virtual ~IChunkedRequestReader() |
57 { | 58 { |
58 } | 59 } |
59 | 60 |
60 virtual void AddBodyChunk(const void* data, | 61 virtual void AddBodyChunk(const void* data, |
61 size_t size) = 0; | 62 size_t size) = 0; |
66 | 67 |
67 virtual ~IHttpHandler() | 68 virtual ~IHttpHandler() |
68 { | 69 { |
69 } | 70 } |
70 | 71 |
71 // This function is called for each incomding POST/PUT request | 72 /** |
72 // (new in Orthanc 1.5.7). It allows to deal with chunked transfers. | 73 * This function allows to deal with chunked transfers (new in |
73 virtual IStream* CreateStreamHandler(RequestOrigin origin, | 74 * Orthanc 1.5.7). It is only called if "method" is POST or PUT. |
74 const char* remoteIp, | 75 **/ |
75 const char* username, | 76 virtual bool CreateChunkedRequestReader(std::auto_ptr<IChunkedRequestReader>& target, |
76 HttpMethod method, | 77 RequestOrigin origin, |
77 const UriComponents& uri, | 78 const char* remoteIp, |
78 const Arguments& headers) = 0; | 79 const char* username, |
80 HttpMethod method, | |
81 const UriComponents& uri, | |
82 const Arguments& headers) = 0; | |
79 | 83 |
80 virtual bool Handle(HttpOutput& output, | 84 virtual bool Handle(HttpOutput& output, |
81 RequestOrigin origin, | 85 RequestOrigin origin, |
82 const char* remoteIp, | 86 const char* remoteIp, |
83 const char* username, | 87 const char* username, |