diff options
author | Dave Hiller <daveh@lindenlab.com> | 2008-07-31 12:15:15 +0000 |
---|---|---|
committer | Dave Hiller <daveh@lindenlab.com> | 2008-07-31 12:15:15 +0000 |
commit | 9a7d68cfce5f71cf9d89536431d72941dc369749 (patch) | |
tree | f7e0ce093abef0fcc7737cac63bc2a8dbf11b729 /indra/llmessage | |
parent | f0f2a416911ba8de9ac1e08cd90720c0d789bb2e (diff) |
svn merge -r93014:93396 svn+ssh://svn.lindenlab.com/svn/linden/branches/mono-r93014-qar633 dataserver-is-deprecated
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llhttpclient.cpp | 29 | ||||
-rw-r--r-- | indra/llmessage/llhttpclient.h | 6 | ||||
-rw-r--r-- | indra/llmessage/llregionflags.h | 4 | ||||
-rwxr-xr-x | indra/llmessage/llsdmessagereader.cpp | 10 |
4 files changed, 32 insertions, 17 deletions
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 2937edd853..7a6add6282 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -122,7 +122,7 @@ namespace { public: RawInjector(const U8* data, S32 size) : mData(data), mSize(size) {} - virtual ~RawInjector() {} + virtual ~RawInjector() {delete mData;} const char* contentType() { return "application/octet-stream"; } @@ -153,16 +153,21 @@ namespace LLBufferStream ostream(channels, buffer.get()); llifstream fstream(mFilename, std::iostream::binary | std::iostream::out); - fstream.seekg(0, std::ios::end); - U32 fileSize = fstream.tellg(); - fstream.seekg(0, std::ios::beg); - char* fileBuffer; - fileBuffer = new char [fileSize]; - fstream.read(fileBuffer, fileSize); - ostream.write(fileBuffer, fileSize); - fstream.close(); - eos = true; - return STATUS_DONE; + if(fstream.is_open()) + { + fstream.seekg(0, std::ios::end); + U32 fileSize = fstream.tellg(); + fstream.seekg(0, std::ios::beg); + char* fileBuffer; + fileBuffer = new char [fileSize]; + fstream.read(fileBuffer, fileSize); + ostream.write(fileBuffer, fileSize); + fstream.close(); + eos = true; + return STATUS_DONE; + } + + return STATUS_ERROR; } const std::string mFilename; @@ -402,7 +407,7 @@ void LLHTTPClient::post(const std::string& url, const LLSD& body, ResponderPtr r request(url, LLURLRequest::HTTP_POST, new LLSDInjector(body), responder, timeout); } -void LLHTTPClient::post(const std::string& url, const U8* data, S32 size, ResponderPtr responder, const F32 timeout) +void LLHTTPClient::postRaw(const std::string& url, const U8* data, S32 size, ResponderPtr responder, const F32 timeout) { request(url, LLURLRequest::HTTP_POST, new RawInjector(data, size), responder, timeout); } diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index 57895aeec9..af79662be9 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -72,8 +72,12 @@ public: static void getHeaderOnly(const std::string& url, ResponderPtr, const LLSD& headers, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); static void post(const std::string& url, const LLSD& body, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void post(const std::string& url, const U8* data, S32 size, ResponderPtr responder, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + + /** Takes ownership of data and deletes it when sent */ + static void postRaw(const std::string& url, const U8* data, S32 size, ResponderPtr responder, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + static void postFile(const std::string& url, const std::string& filename, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + # static void postFile(const std::string& url, const LLUUID& uuid, LLAssetType::EType asset_type, ResponderPtr responder, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h index aa9964d46b..972a184a62 100644 --- a/indra/llmessage/llregionflags.h +++ b/indra/llmessage/llregionflags.h @@ -94,8 +94,8 @@ const U32 REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER = (1 << 27); const U32 REGION_FLAGS_ALLOW_VOICE = (1 << 28); const U32 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29); -const U32 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30); - +const U32 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30); +const U32 REGION_FLAGS_SKIP_MONO_SCRIPTS = (1 << 31); const U32 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK | REGION_FLAGS_ALLOW_SET_HOME | diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp index b7d0267423..5fb3708859 100755 --- a/indra/llmessage/llsdmessagereader.cpp +++ b/indra/llmessage/llsdmessagereader.cpp @@ -71,14 +71,20 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum } if(! input[block].isArray()) { - llerrs << "block " << block << " not found" << llendl; + // NOTE: babbage: need to return default for missing blocks to allow + // backwards/forwards compatibility - handlers must cope with default + // values. + llwarns << "block " << block << " not found" << llendl; return LLSD(); } LLSD result = input[block][blocknum][var]; if(result.isUndefined()) { - llerrs << "var " << var << " not found" << llendl; + // NOTE: babbage: need to return default for missing vars to allow + // backwards/forwards compatibility - handlers must cope with default + // values. + llwarns << "var " << var << " not found" << llendl; } return result; } |