aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llhttpnode.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llmessage/llhttpnode.h
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/llmessage/llhttpnode.h88
1 files changed, 67 insertions, 21 deletions
diff --git a/linden/indra/llmessage/llhttpnode.h b/linden/indra/llmessage/llhttpnode.h
index 02e8ceb..4339e5c 100644
--- a/linden/indra/llmessage/llhttpnode.h
+++ b/linden/indra/llmessage/llhttpnode.h
@@ -82,33 +82,79 @@ public:
82 */ 82 */
83 //@{ 83 //@{
84public: 84public:
85 virtual LLSD get() const;
86 virtual LLSD put(const LLSD& input) const;
87 virtual LLSD post(const LLSD& input) const;
88 85
89 virtual LLSD del(const LLSD& context) const; 86 virtual LLSD get() const;
87 virtual LLSD put(const LLSD& input) const;
88 virtual LLSD post(const LLSD& input) const;
89 virtual LLSD del(const LLSD& context) const;
90 90
91 class Response : public LLRefCount 91 class Response : public LLRefCount
92 { 92 {
93 protected: 93 protected:
94 virtual ~Response(); 94 virtual ~Response();
95 95
96 public: 96 public:
97 virtual void result(const LLSD&) = 0; 97 /**
98 virtual void status(S32 code, const std::string& message) = 0; 98 * @brief Return the LLSD content and a 200 OK.
99 */
100 virtual void result(const LLSD&) = 0;
101
102 /**
103 * @brief return status code and reason string on http header,
104 * but do not return a payload.
105 */
106 virtual void status(S32 code, const std::string& message) = 0;
107
108 /**
109 * @brief Return no body, just status code and 'UNKNOWN ERROR'.
110 */
111 void status(S32 code);
112
113 void notFound(const std::string& message);
114 void notFound();
115 void methodNotAllowed();
116
117 /**
118 * @breif Add a name: value http header.
119 *
120 * No effort is made to ensure the response is a valid http
121 * header.
122 * The headers are stored as a map of header name : value.
123 * Though HTTP allows the same header name to be transmitted
124 * more than once, this implementation only stores a header
125 * name once.
126 * @param name The name of the header, eg, "Content-Encoding"
127 * @param value The value of the header, eg, "gzip"
128 */
129 void addHeader(const std::string& name, const std::string& value);
130
131 protected:
132 /**
133 * @brief Headers to be sent back with the HTTP response.
134 *
135 * Protected class membership since derived classes are
136 * expected to use it and there is no use case yet for other
137 * uses. If such a use case arises, I suggest making a
138 * headers() public method, and moving this member data into
139 * private.
140 */
141 LLSD mHeaders;
142 };
99 143
100 void status(S32 code);
101 void notFound(const std::string& message);
102 void notFound();
103 void methodNotAllowed();
104 };
105 144
106 typedef LLPointer<Response> ResponsePtr; 145 typedef LLPointer<Response> ResponsePtr;
107 146
108 virtual void get(ResponsePtr, const LLSD& context) const; 147 virtual void get(ResponsePtr, const LLSD& context) const;
109 virtual void put(ResponsePtr, const LLSD& context, const LLSD& input) const; 148 virtual void put(
110 virtual void post(ResponsePtr, const LLSD& context, const LLSD& input) const; 149 ResponsePtr,
111 virtual void del(ResponsePtr, const LLSD& context) const; 150 const LLSD& context,
151 const LLSD& input) const;
152 virtual void post(
153 ResponsePtr,
154 const LLSD& context,
155 const LLSD& input) const;
156 virtual void del(ResponsePtr, const LLSD& context) const;
157 virtual void options(ResponsePtr, const LLSD& context) const;
112 //@} 158 //@}
113 159
114 160