aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:48 -0500
committerJacek Antonelli2008-08-15 23:44:48 -0500
commit9b4f54c826ffa4f94efa866068c9d6ecdfb4b424 (patch)
tree2f8ae193ab487088962e628f1ee9dee2f5901f01 /linden/indra/llmessage
parentSecond Life viewer sources 1.13.2.12 (diff)
downloadmeta-impy-9b4f54c826ffa4f94efa866068c9d6ecdfb4b424.zip
meta-impy-9b4f54c826ffa4f94efa866068c9d6ecdfb4b424.tar.gz
meta-impy-9b4f54c826ffa4f94efa866068c9d6ecdfb4b424.tar.bz2
meta-impy-9b4f54c826ffa4f94efa866068c9d6ecdfb4b424.tar.xz
Second Life viewer sources 1.13.2.15
Diffstat (limited to 'linden/indra/llmessage')
-rw-r--r--linden/indra/llmessage/llcachename.cpp18
-rw-r--r--linden/indra/llmessage/llcircuit.cpp6
-rw-r--r--linden/indra/llmessage/llpacketring.cpp4
-rw-r--r--linden/indra/llmessage/llpumpio.cpp1
-rw-r--r--linden/indra/llmessage/llurlrequest.cpp1
-rw-r--r--linden/indra/llmessage/llxfermanager.cpp2
6 files changed, 19 insertions, 13 deletions
diff --git a/linden/indra/llmessage/llcachename.cpp b/linden/indra/llmessage/llcachename.cpp
index 9995a6e..3a92812 100644
--- a/linden/indra/llmessage/llcachename.cpp
+++ b/linden/indra/llmessage/llcachename.cpp
@@ -284,6 +284,7 @@ void LLCacheName::importFile(FILE* fp)
284 const S32 BUFFER_SIZE = 1024; 284 const S32 BUFFER_SIZE = 1024;
285 char buffer[BUFFER_SIZE]; /*Flawfinder: ignore*/ 285 char buffer[BUFFER_SIZE]; /*Flawfinder: ignore*/
286 286
287 // *NOTE: These buffer sizes are hardcoded into sscanf() below
287 char id_string[MAX_STRING]; /*Flawfinder: ignore*/ 288 char id_string[MAX_STRING]; /*Flawfinder: ignore*/
288 char firstname[MAX_STRING]; /*Flawfinder: ignore*/ 289 char firstname[MAX_STRING]; /*Flawfinder: ignore*/
289 char lastname[MAX_STRING]; /*Flawfinder: ignore*/ 290 char lastname[MAX_STRING]; /*Flawfinder: ignore*/
@@ -293,9 +294,10 @@ void LLCacheName::importFile(FILE* fp)
293 char* valid = fgets(buffer, BUFFER_SIZE, fp); 294 char* valid = fgets(buffer, BUFFER_SIZE, fp);
294 if (!valid) return; 295 if (!valid) return;
295 296
297 // *NOTE: This buffer size is hardcoded into sscanf() below
296 char version_string[BUFFER_SIZE]; /*Flawfinder: ignore*/ 298 char version_string[BUFFER_SIZE]; /*Flawfinder: ignore*/
297 S32 version = 0; 299 S32 version = 0;
298 S32 match = sscanf(buffer, "%s %d", version_string, &version); // XXXTBD 300 S32 match = sscanf(buffer, "%1023s %d", version_string, &version);
299 if ( match != 2 301 if ( match != 2
300 || strcmp(version_string, "version") 302 || strcmp(version_string, "version")
301 || version != CN_FILE_VERSION) 303 || version != CN_FILE_VERSION)
@@ -314,11 +316,13 @@ void LLCacheName::importFile(FILE* fp)
314 valid = fgets(buffer, BUFFER_SIZE, fp); 316 valid = fgets(buffer, BUFFER_SIZE, fp);
315 if (!valid) break; 317 if (!valid) break;
316 318
317 match = sscanf(buffer, "%s %u %s %s", // XXXTBD 319 match = sscanf(
318 id_string, 320 buffer,
319 &create_time, 321 "%254s %u %254s %254s",
320 firstname, 322 id_string,
321 lastname); 323 &create_time,
324 firstname,
325 lastname);
322 if (4 != match) continue; 326 if (4 != match) continue;
323 327
324 LLUUID id(id_string); 328 LLUUID id(id_string);
@@ -409,7 +413,7 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last)
409 { 413 {
410 //The function signature needs to change to pass in the 414 //The function signature needs to change to pass in the
411 //length of first and last. 415 //length of first and last.
412 strcpy(first,(frand(1.0f) < HIPPO_PROBABILITY) 416 strcpy(first,(ll_frand() < HIPPO_PROBABILITY)
413 ? CN_HIPPOS 417 ? CN_HIPPOS
414 : CN_WAITING); 418 : CN_WAITING);
415 strcpy(last, ""); 419 strcpy(last, "");
diff --git a/linden/indra/llmessage/llcircuit.cpp b/linden/indra/llmessage/llcircuit.cpp
index 7d3136b..5187948 100644
--- a/linden/indra/llmessage/llcircuit.cpp
+++ b/linden/indra/llmessage/llcircuit.cpp
@@ -105,12 +105,12 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id)
105 // Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been 105 // Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been
106 // running a message system loop. 106 // running a message system loop.
107 F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(TRUE); 107 F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(TRUE);
108 F32 distribution_offset = frand(1.0f); 108 F32 distribution_offset = ll_frand();
109 109
110 mPingTime = mt_sec; 110 mPingTime = mt_sec;
111 mLastPingSendTime = mt_sec + PING_INTERVAL * distribution_offset; 111 mLastPingSendTime = mt_sec + PING_INTERVAL * distribution_offset;
112 mLastPingReceivedTime = mt_sec; 112 mLastPingReceivedTime = mt_sec;
113 mNextPingSendTime = mLastPingSendTime + 0.95*PING_INTERVAL + frand(0.1f*PING_INTERVAL); 113 mNextPingSendTime = mLastPingSendTime + 0.95*PING_INTERVAL + ll_frand(0.1f*PING_INTERVAL);
114 mPeriodTime = mt_sec; 114 mPeriodTime = mt_sec;
115 115
116 mTimeoutCallback = NULL; 116 mTimeoutCallback = NULL;
@@ -804,7 +804,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
804 if (cdp->updateWatchDogTimers(msgsys)) 804 if (cdp->updateWatchDogTimers(msgsys))
805 { 805 {
806 // Randomize our pings a bit by doing some up to 5% early or late 806 // Randomize our pings a bit by doing some up to 5% early or late
807 F64 dt = 0.95f*PING_INTERVAL + frand(0.1f*PING_INTERVAL); 807 F64 dt = 0.95f*PING_INTERVAL + ll_frand(0.1f*PING_INTERVAL);
808 808
809 // Remove it, and reinsert it with the new next ping time. 809 // Remove it, and reinsert it with the new next ping time.
810 // Always remove before changing the sorting key. 810 // Always remove before changing the sorting key.
diff --git a/linden/indra/llmessage/llpacketring.cpp b/linden/indra/llmessage/llpacketring.cpp
index 3876d76..6a6a456 100644
--- a/linden/indra/llmessage/llpacketring.cpp
+++ b/linden/indra/llmessage/llpacketring.cpp
@@ -166,7 +166,7 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap)
166 mActualBitsIn += packetp->getSize() * 8; 166 mActualBitsIn += packetp->getSize() * 8;
167 167
168 // Fake packet loss 168 // Fake packet loss
169 if (mDropPercentage && (frand(100.f) < mDropPercentage)) 169 if (mDropPercentage && (ll_frand(100.f) < mDropPercentage))
170 { 170 {
171 mPacketsToDrop++; 171 mPacketsToDrop++;
172 } 172 }
@@ -221,7 +221,7 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap)
221 221
222 if (packet_size) // did we actually get a packet? 222 if (packet_size) // did we actually get a packet?
223 { 223 {
224 if (mDropPercentage && (frand(100.f) < mDropPercentage)) 224 if (mDropPercentage && (ll_frand(100.f) < mDropPercentage))
225 { 225 {
226 mPacketsToDrop++; 226 mPacketsToDrop++;
227 } 227 }
diff --git a/linden/indra/llmessage/llpumpio.cpp b/linden/indra/llmessage/llpumpio.cpp
index 853a438..b1495f6 100644
--- a/linden/indra/llmessage/llpumpio.cpp
+++ b/linden/indra/llmessage/llpumpio.cpp
@@ -335,6 +335,7 @@ bool LLPumpIO::copyCurrentLinkInfo(links_t& links) const
335void LLPumpIO::pump() 335void LLPumpIO::pump()
336{ 336{
337 LLMemType m1(LLMemType::MTYPE_IO_PUMP); 337 LLMemType m1(LLMemType::MTYPE_IO_PUMP);
338 LLFastTimer t1(LLFastTimer::FTM_PUMP);
338 //llinfos << "LLPumpIO::pump()" << llendl; 339 //llinfos << "LLPumpIO::pump()" << llendl;
339 340
340 // Run any pending runners. 341 // Run any pending runners.
diff --git a/linden/indra/llmessage/llurlrequest.cpp b/linden/indra/llmessage/llurlrequest.cpp
index c0d8d27..8ac8d94 100644
--- a/linden/indra/llmessage/llurlrequest.cpp
+++ b/linden/indra/llmessage/llurlrequest.cpp
@@ -270,6 +270,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
270 S32 queue; 270 S32 queue;
271 do 271 do
272 { 272 {
273 LLFastTimer t2(LLFastTimer::FTM_CURL);
273 code = curl_multi_perform(mDetail->mCurlMulti, &queue); 274 code = curl_multi_perform(mDetail->mCurlMulti, &queue);
274 }while((CURLM_CALL_MULTI_PERFORM == code) && (queue > 0) && count--); 275 }while((CURLM_CALL_MULTI_PERFORM == code) && (queue > 0) && count--);
275 CURLMsg* curl_msg; 276 CURLMsg* curl_msg;
diff --git a/linden/indra/llmessage/llxfermanager.cpp b/linden/indra/llmessage/llxfermanager.cpp
index d10c879..afeeef3 100644
--- a/linden/indra/llmessage/llxfermanager.cpp
+++ b/linden/indra/llmessage/llxfermanager.cpp
@@ -1108,7 +1108,7 @@ void process_request_xfer(LLMessageSystem *mesgsys, void **user_data)
1108void continue_file_receive(LLMessageSystem *mesgsys, void **user_data) 1108void continue_file_receive(LLMessageSystem *mesgsys, void **user_data)
1109{ 1109{
1110#if LL_TEST_XFER_REXMIT 1110#if LL_TEST_XFER_REXMIT
1111 if (frand(1.f) > 0.05f) 1111 if (ll_frand() > 0.05f)
1112 { 1112 {
1113#endif 1113#endif
1114 gXferManager->processReceiveData(mesgsys,user_data); 1114 gXferManager->processReceiveData(mesgsys,user_data);