aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcommon')
-rw-r--r--linden/indra/llcommon/llsdserialize.cpp5
-rw-r--r--linden/indra/llcommon/llsdserialize_xml.cpp16
-rw-r--r--linden/indra/llcommon/llstring.cpp34
-rw-r--r--linden/indra/llcommon/llstring.h2
4 files changed, 49 insertions, 8 deletions
diff --git a/linden/indra/llcommon/llsdserialize.cpp b/linden/indra/llcommon/llsdserialize.cpp
index e2be922..f648c5c 100644
--- a/linden/indra/llcommon/llsdserialize.cpp
+++ b/linden/indra/llcommon/llsdserialize.cpp
@@ -1447,9 +1447,12 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
1447 } 1447 }
1448 1448
1449 case LLSD::TypeUUID: 1449 case LLSD::TypeUUID:
1450 {
1450 ostr.put('u'); 1451 ostr.put('u');
1451 ostr.write((const char*)(&(data.asUUID().mData)), UUID_BYTES); 1452 U8 *value = data.asUUID().mData;
1453 ostr.write((const char*)(&value), UUID_BYTES);
1452 break; 1454 break;
1455 }
1453 1456
1454 case LLSD::TypeString: 1457 case LLSD::TypeString:
1455 ostr.put('s'); 1458 ostr.put('s');
diff --git a/linden/indra/llcommon/llsdserialize_xml.cpp b/linden/indra/llcommon/llsdserialize_xml.cpp
index 7729a5f..7c3dcbf 100644
--- a/linden/indra/llcommon/llsdserialize_xml.cpp
+++ b/linden/indra/llcommon/llsdserialize_xml.cpp
@@ -394,13 +394,15 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
394 if (status == XML_STATUS_ERROR) 394 if (status == XML_STATUS_ERROR)
395 { 395 {
396 std::string error_string(XML_ErrorString(XML_GetErrorCode( mParser ))); 396 std::string error_string(XML_ErrorString(XML_GetErrorCode( mParser )));
397// if (input.gcount() == 0) 397 // I know, this if seems odd, but it fixes a problem with not being able to see nearby sims, or TP to other sims.
398// { 398 // No idea why.
399// // nothing to do -- MC 399 if (input && (input.gcount() == 0))
400// data = LLSD(); 400 {
401// return LLSDParser::PARSE_FAILURE; 401 // nothing to do -- MC
402// } 402 data = LLSD();
403 /*else*/ if (error_string != "parsing aborted") // end of input 403 return LLSDParser::PARSE_FAILURE;
404 }
405 else if (error_string != "parsing aborted") // end of input
404 { 406 {
405 S32 line_number = XML_GetCurrentLineNumber( mParser ); 407 S32 line_number = XML_GetCurrentLineNumber( mParser );
406 // This parses LLCurl::Responder::completedRaw always, even 408 // This parses LLCurl::Responder::completedRaw always, even
diff --git a/linden/indra/llcommon/llstring.cpp b/linden/indra/llcommon/llstring.cpp
index 95aa7b5..fe0ab2a 100644
--- a/linden/indra/llcommon/llstring.cpp
+++ b/linden/indra/llcommon/llstring.cpp
@@ -596,6 +596,40 @@ std::string utf8str_removeCRLF(const std::string& utf8str)
596 return out; 596 return out;
597} 597}
598 598
599bool is_hex_string(U8* str, S32 len)
600{
601 bool rv = true;
602 U8* c = str;
603 while(rv && len--)
604 {
605 switch(*c)
606 {
607 case '0':
608 case '1':
609 case '2':
610 case '3':
611 case '4':
612 case '5':
613 case '6':
614 case '7':
615 case '8':
616 case '9':
617 case 'a':
618 case 'b':
619 case 'c':
620 case 'd':
621 case 'e':
622 case 'f':
623 ++c;
624 break;
625 default:
626 rv = false;
627 break;
628 }
629 }
630 return rv;
631}
632
599bool LLStringOps::isHexString(const std::string& str) 633bool LLStringOps::isHexString(const std::string& str)
600{ 634{
601 const char* buf = str.c_str(); 635 const char* buf = str.c_str();
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h
index ced9713..e1b5cbd 100644
--- a/linden/indra/llcommon/llstring.h
+++ b/linden/indra/llcommon/llstring.h
@@ -458,6 +458,8 @@ LL_COMMON_API std::string mbcsstring_makeASCII(const std::string& str);
458 458
459LL_COMMON_API std::string utf8str_removeCRLF(const std::string& utf8str); 459LL_COMMON_API std::string utf8str_removeCRLF(const std::string& utf8str);
460 460
461LL_COMMON_API bool is_hex_string(U8* str, S32 len);
462
461 463
462#if LL_WINDOWS 464#if LL_WINDOWS
463/* @name Windows string helpers 465/* @name Windows string helpers