aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llmessage/llhttpclient.cpp22
-rw-r--r--linden/indra/llmessage/llhttpclient.h3
2 files changed, 14 insertions, 11 deletions
diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp
index c26ef5e..7c7fe59 100644
--- a/linden/indra/llmessage/llhttpclient.cpp
+++ b/linden/indra/llmessage/llhttpclient.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$ 5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2006-2009, Linden Research, Inc. 7 * Copyright (c) 2006-2010, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -161,10 +161,9 @@ namespace
161 fstream.seekg(0, std::ios::end); 161 fstream.seekg(0, std::ios::end);
162 U32 fileSize = fstream.tellg(); 162 U32 fileSize = fstream.tellg();
163 fstream.seekg(0, std::ios::beg); 163 fstream.seekg(0, std::ios::beg);
164 char* fileBuffer; 164 std::vector<char> fileBuffer(fileSize);
165 fileBuffer = new char [fileSize]; 165 fstream.read(&fileBuffer[0], fileSize);
166 fstream.read(fileBuffer, fileSize); 166 ostream.write(&fileBuffer[0], fileSize);
167 ostream.write(fileBuffer, fileSize);
168 fstream.close(); 167 fstream.close();
169 eos = true; 168 eos = true;
170 return STATUS_DONE; 169 return STATUS_DONE;
@@ -191,11 +190,9 @@ namespace
191 190
192 LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ); 191 LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ);
193 S32 fileSize = vfile.getSize(); 192 S32 fileSize = vfile.getSize();
194 U8* fileBuffer; 193 std::vector<U8> fileBuffer(fileSize);
195 fileBuffer = new U8 [fileSize]; 194 vfile.read(&fileBuffer[0], fileSize);
196 vfile.read(fileBuffer, fileSize); 195 ostream.write((char*)&fileBuffer[0], fileSize);
197 ostream.write((char*)fileBuffer, fileSize);
198 delete [] fileBuffer;
199 eos = true; 196 eos = true;
200 return STATUS_DONE; 197 return STATUS_DONE;
201 } 198 }
@@ -528,3 +525,8 @@ bool LLHTTPClient::hasPump()
528{ 525{
529 return theClientPump != NULL; 526 return theClientPump != NULL;
530} 527}
528
529LLPumpIO &LLHTTPClient::getPump()
530{
531 return *theClientPump;
532}
diff --git a/linden/indra/llmessage/llhttpclient.h b/linden/indra/llmessage/llhttpclient.h
index a0c9fac..ab8afe8 100644
--- a/linden/indra/llmessage/llhttpclient.h
+++ b/linden/indra/llmessage/llhttpclient.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$ 5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2006-2009, Linden Research, Inc. 7 * Copyright (c) 2006-2010, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -148,6 +148,7 @@ public:
148 ///< must be called before any of the above calls are made 148 ///< must be called before any of the above calls are made
149 static bool hasPump(); 149 static bool hasPump();
150 ///< for testing 150 ///< for testing
151 static LLPumpIO &getPump();
151}; 152};
152 153
153#endif // LL_LLHTTPCLIENT_H 154#endif // LL_LLHTTPCLIENT_H