diff options
Diffstat (limited to 'linden/indra/llmessage/llhttpclient.cpp')
-rw-r--r-- | linden/indra/llmessage/llhttpclient.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp index a07f379..8a4b063 100644 --- a/linden/indra/llmessage/llhttpclient.cpp +++ b/linden/indra/llmessage/llhttpclient.cpp | |||
@@ -160,10 +160,9 @@ namespace | |||
160 | fstream.seekg(0, std::ios::end); | 160 | fstream.seekg(0, std::ios::end); |
161 | U32 fileSize = fstream.tellg(); | 161 | U32 fileSize = fstream.tellg(); |
162 | fstream.seekg(0, std::ios::beg); | 162 | fstream.seekg(0, std::ios::beg); |
163 | char* fileBuffer; | 163 | std::vector<char> fileBuffer(fileSize); |
164 | fileBuffer = new char [fileSize]; | 164 | fstream.read(&fileBuffer[0], fileSize); |
165 | fstream.read(fileBuffer, fileSize); | 165 | ostream.write(&fileBuffer[0], fileSize); |
166 | ostream.write(fileBuffer, fileSize); | ||
167 | fstream.close(); | 166 | fstream.close(); |
168 | eos = true; | 167 | eos = true; |
169 | return STATUS_DONE; | 168 | return STATUS_DONE; |
@@ -190,10 +189,9 @@ namespace | |||
190 | 189 | ||
191 | LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ); | 190 | LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ); |
192 | S32 fileSize = vfile.getSize(); | 191 | S32 fileSize = vfile.getSize(); |
193 | U8* fileBuffer; | 192 | std::vector<U8> fileBuffer(fileSize); |
194 | fileBuffer = new U8 [fileSize]; | 193 | vfile.read(&fileBuffer[0], fileSize); |
195 | vfile.read(fileBuffer, fileSize); | 194 | ostream.write((char*)&fileBuffer[0], fileSize); |
196 | ostream.write((char*)fileBuffer, fileSize); | ||
197 | eos = true; | 195 | eos = true; |
198 | return STATUS_DONE; | 196 | return STATUS_DONE; |
199 | } | 197 | } |