summaryrefslogtreecommitdiff
path: root/indra/llmessage/llhttpclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llhttpclient.cpp')
-rw-r--r--indra/llmessage/llhttpclient.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index d83308d082..f93a12b274 100644
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -131,6 +131,27 @@ namespace
const LLSD mSD;
};
+
+ class RawInjector : public Injector
+ {
+ public:
+ RawInjector(const U8* data, S32 size) : mData(data), mSize(size) {}
+ virtual ~RawInjector() {}
+
+ const char* contentType() { return "application/octet-stream"; }
+
+ virtual EStatus process_impl(const LLChannelDescriptors& channels,
+ buffer_ptr_t& buffer, bool& eos, LLSD& context, LLPumpIO* pump)
+ {
+ LLBufferStream ostream(channels, buffer.get());
+ ostream.write((const char *)mData, mSize); // hopefully chars are always U8s
+ eos = true;
+ return STATUS_DONE;
+ }
+
+ const U8* mData;
+ S32 mSize;
+ };
class FileInjector : public Injector
{
@@ -301,6 +322,11 @@ void LLHTTPClient::post(const std::string& url, const LLSD& body, ResponderPtr r
request(url, LLURLRequest::HTTP_POST, new LLSDInjector(body), responder);
}
+void LLHTTPClient::post(const std::string& url, const U8* data, S32 size, ResponderPtr responder)
+{
+ request(url, LLURLRequest::HTTP_POST, new RawInjector(data, size), responder);
+}
+
void LLHTTPClient::del(const std::string& url, ResponderPtr responder)
{
request(url, LLURLRequest::HTTP_DELETE, NULL, responder);