aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcommon')
-rw-r--r--linden/indra/llcommon/llapp.cpp34
-rw-r--r--linden/indra/llcommon/llavatarconstants.h1
-rw-r--r--linden/indra/llcommon/llcommon.vcproj3
-rw-r--r--linden/indra/llcommon/llcommon_vc8.vcproj2
-rw-r--r--linden/indra/llcommon/llsd.cpp20
-rw-r--r--linden/indra/llcommon/llsd.h1
-rw-r--r--linden/indra/llcommon/llsdserialize.cpp5
-rw-r--r--linden/indra/llcommon/llstring.cpp58
-rw-r--r--linden/indra/llcommon/llstring.h32
-rw-r--r--linden/indra/llcommon/llsys.cpp77
-rw-r--r--linden/indra/llcommon/llsys.h2
-rw-r--r--linden/indra/llcommon/lluri.cpp69
-rw-r--r--linden/indra/llcommon/lluri.h7
-rw-r--r--linden/indra/llcommon/llversionserver.h4
-rw-r--r--linden/indra/llcommon/llversionviewer.h4
15 files changed, 256 insertions, 63 deletions
diff --git a/linden/indra/llcommon/llapp.cpp b/linden/indra/llcommon/llapp.cpp
index b0751b8..2347ac9 100644
--- a/linden/indra/llcommon/llapp.cpp
+++ b/linden/indra/llcommon/llapp.cpp
@@ -47,6 +47,7 @@
47// 47//
48#if LL_WINDOWS 48#if LL_WINDOWS
49LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop); 49LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop);
50BOOL ConsoleCtrlHandler(DWORD fdwCtrlType);
50#else 51#else
51#include <unistd.h> // for fork() 52#include <unistd.h> // for fork()
52void setup_signals(); 53void setup_signals();
@@ -219,6 +220,11 @@ void LLApp::setupErrorHandling()
219 // Disable this until the viewer gets ported so server crashes can be JIT debugged. 220 // Disable this until the viewer gets ported so server crashes can be JIT debugged.
220 //LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; 221 //LPTOP_LEVEL_EXCEPTION_FILTER prev_filter;
221 //prev_filter = SetUnhandledExceptionFilter(default_windows_exception_handler); 222 //prev_filter = SetUnhandledExceptionFilter(default_windows_exception_handler);
223
224 // This sets a callback to handle w32 signals to the console window.
225 // The viewer shouldn't be affected, sicne its a windowed app.
226 SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ConsoleCtrlHandler, TRUE);
227
222#else 228#else
223 // 229 //
224 // Start up signal handling. 230 // Start up signal handling.
@@ -399,6 +405,34 @@ LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *except
399 return retval; 405 return retval;
400} 406}
401 407
408// Win32 doesn't support signals. This is used instead.
409BOOL ConsoleCtrlHandler(DWORD fdwCtrlType)
410{
411 switch (fdwCtrlType)
412 {
413 case CTRL_BREAK_EVENT:
414 case CTRL_LOGOFF_EVENT:
415 case CTRL_SHUTDOWN_EVENT:
416 case CTRL_CLOSE_EVENT: // From end task or the window close button.
417 case CTRL_C_EVENT: // from CTRL-C on the keyboard
418 // Just set our state to quitting, not error
419 if (LLApp::isQuitting() || LLApp::isError())
420 {
421 // We're already trying to die, just ignore this signal
422 if (LLApp::sLogInSignal)
423 {
424 llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl;
425 }
426 return TRUE;
427 }
428 LLApp::setQuitting();
429 return TRUE;
430
431 default:
432 return FALSE;
433 }
434}
435
402#else //!LL_WINDOWS 436#else //!LL_WINDOWS
403void LLApp::setChildCallback(pid_t pid, LLAppChildCallback callback) 437void LLApp::setChildCallback(pid_t pid, LLAppChildCallback callback)
404{ 438{
diff --git a/linden/indra/llcommon/llavatarconstants.h b/linden/indra/llcommon/llavatarconstants.h
index c62cae2..4ba6642 100644
--- a/linden/indra/llcommon/llavatarconstants.h
+++ b/linden/indra/llcommon/llavatarconstants.h
@@ -49,6 +49,7 @@ const U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature"
49const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info 49const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info
50const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info 50const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info
51const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known. 51const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known.
52const U32 AVATAR_AGEVERIFIED = 0x1 << 5; // whether avatar has been age-verified
52 53
53static const std::string VISIBILITY_DEFAULT("default"); 54static const std::string VISIBILITY_DEFAULT("default");
54static const std::string VISIBILITY_HIDDEN("hidden"); 55static const std::string VISIBILITY_HIDDEN("hidden");
diff --git a/linden/indra/llcommon/llcommon.vcproj b/linden/indra/llcommon/llcommon.vcproj
index 80704af..0ab544e 100644
--- a/linden/indra/llcommon/llcommon.vcproj
+++ b/linden/indra/llcommon/llcommon.vcproj
@@ -415,6 +415,9 @@
415 RelativePath=".\llindexedqueue.h"> 415 RelativePath=".\llindexedqueue.h">
416 </File> 416 </File>
417 <File 417 <File
418 RelativePath=".\llkeythrottle.h">
419 </File>
420 <File
418 RelativePath=".\lllinkedqueue.h"> 421 RelativePath=".\lllinkedqueue.h">
419 </File> 422 </File>
420 <File 423 <File
diff --git a/linden/indra/llcommon/llcommon_vc8.vcproj b/linden/indra/llcommon/llcommon_vc8.vcproj
index 1687a89..4790b61 100644
--- a/linden/indra/llcommon/llcommon_vc8.vcproj
+++ b/linden/indra/llcommon/llcommon_vc8.vcproj
@@ -201,7 +201,9 @@
201 /> 201 />
202 <Tool 202 <Tool
203 Name="VCLibrarianTool" 203 Name="VCLibrarianTool"
204 AdditionalDependencies="psapi.lib"
204 OutputFile="$(OutDir)/llcommon.lib" 205 OutputFile="$(OutDir)/llcommon.lib"
206 AdditionalLibraryDirectories=""
205 /> 207 />
206 <Tool 208 <Tool
207 Name="VCALinkTool" 209 Name="VCALinkTool"
diff --git a/linden/indra/llcommon/llsd.cpp b/linden/indra/llcommon/llsd.cpp
index 305531b..829ea25 100644
--- a/linden/indra/llcommon/llsd.cpp
+++ b/linden/indra/llcommon/llsd.cpp
@@ -36,11 +36,23 @@
36#include "../llmath/llmath.h" 36#include "../llmath/llmath.h"
37#include "llformat.h" 37#include "llformat.h"
38 38
39#ifndef LL_RELEASE_FOR_DOWNLOAD
40#define NAME_UNNAMED_NAMESPACE
41#endif
42
43#ifdef NAME_UNNAMED_NAMESPACE
44namespace LLSDUnnamedNamespace {
45#else
39namespace { 46namespace {
47#endif
40 class ImplMap; 48 class ImplMap;
41 class ImplArray; 49 class ImplArray;
42} 50}
43 51
52#ifdef NAME_UNNAMED_NAMESPACE
53using namespace LLSDUnnamedNamespace;
54#endif
55
44class LLSD::Impl 56class LLSD::Impl
45 /**< This class is the abstract base class of the implementation of LLSD 57 /**< This class is the abstract base class of the implementation of LLSD
46 It provides the reference counting implementation, and the default 58 It provides the reference counting implementation, and the default
@@ -125,7 +137,11 @@ public:
125 static U32 sOutstandingCount; 137 static U32 sOutstandingCount;
126}; 138};
127 139
140#ifdef NAME_UNNAMED_NAMESPACE
141namespace LLSDUnnamedNamespace {
142#else
128namespace { 143namespace {
144#endif
129 template<LLSD::Type T, class Data, class DataRef = Data> 145 template<LLSD::Type T, class Data, class DataRef = Data>
130 class ImplBase : public LLSD::Impl 146 class ImplBase : public LLSD::Impl
131 ///< This class handles most of the work for a subclass of Impl 147 ///< This class handles most of the work for a subclass of Impl
@@ -632,7 +648,11 @@ U32 LLSD::Impl::sOutstandingCount = 0;
632 648
633 649
634 650
651#ifdef NAME_UNNAMED_NAMESPACE
652namespace LLSDUnnamedNamespace {
653#else
635namespace { 654namespace {
655#endif
636 inline LLSD::Impl& safe(LLSD::Impl* impl) 656 inline LLSD::Impl& safe(LLSD::Impl* impl)
637 { return LLSD::Impl::safe(impl); } 657 { return LLSD::Impl::safe(impl); }
638 658
diff --git a/linden/indra/llcommon/llsd.h b/linden/indra/llcommon/llsd.h
index 1fb917f..65ba7dd 100644
--- a/linden/indra/llcommon/llsd.h
+++ b/linden/indra/llcommon/llsd.h
@@ -376,6 +376,7 @@ struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
376 } 376 }
377}; 377};
378 378
379std::ostream& operator<<(std::ostream& s, const LLSD& llsd);
379 380
380/** QUESTIONS & TO DOS 381/** QUESTIONS & TO DOS
381 - Would Binary be more convenient as usigned char* buffer semantics? 382 - Would Binary be more convenient as usigned char* buffer semantics?
diff --git a/linden/indra/llcommon/llsdserialize.cpp b/linden/indra/llcommon/llsdserialize.cpp
index a7470be..5ab9471 100644
--- a/linden/indra/llcommon/llsdserialize.cpp
+++ b/linden/indra/llcommon/llsdserialize.cpp
@@ -1641,4 +1641,9 @@ void serialize_string(const std::string& value, std::ostream& str)
1641 } 1641 }
1642} 1642}
1643 1643
1644std::ostream& operator<<(std::ostream& s, const LLSD& llsd)
1645{
1646 s << LLSDNotationStreamer(llsd);
1647 return s;
1648}
1644 1649
diff --git a/linden/indra/llcommon/llstring.cpp b/linden/indra/llcommon/llstring.cpp
index 6dab598..e701ea0 100644
--- a/linden/indra/llcommon/llstring.cpp
+++ b/linden/indra/llcommon/llstring.cpp
@@ -34,6 +34,13 @@
34#include "llstring.h" 34#include "llstring.h"
35#include "llerror.h" 35#include "llerror.h"
36 36
37#if LL_WINDOWS
38#define WIN32_LEAN_AND_MEAN
39#include <winsock2.h>
40#include <windows.h>
41#include <winnls.h> // for WideCharToMultiByte
42#endif
43
37std::string ll_safe_string(const char* in) 44std::string ll_safe_string(const char* in)
38{ 45{
39 if(in) return std::string(in); 46 if(in) return std::string(in);
@@ -718,19 +725,7 @@ std::string utf8str_removeCRLF(const std::string& utf8str)
718} 725}
719 726
720#if LL_WINDOWS 727#if LL_WINDOWS
721/* If the size of the passed in buffer is not large enough to hold the string, 728// documentation moved to header. Phoenix 2007-11-27
722 * two bad things happen:
723 * 1. resulting formatted string is NOT null terminated
724 * 2. Depending on the platform, the return value could be a) the required
725 * size of the buffer to copy the entire formatted string or b) -1.
726 * On Windows with VS.Net 2003, it returns -1 e.g.
727 *
728 * safe_snprintf always adds a NULL terminator so that the caller does not
729 * need to check for return value or need to add the NULL terminator.
730 * It does not, however change the return value - to let the caller know
731 * that the passed in buffer size was not large enough to hold the formatted string.
732 *
733 */
734int safe_snprintf(char *str, size_t size, const char *format, ...) 729int safe_snprintf(char *str, size_t size, const char *format, ...)
735{ 730{
736 va_list args; 731 va_list args;
@@ -742,6 +737,43 @@ int safe_snprintf(char *str, size_t size, const char *format, ...)
742 str[size-1] = '\0'; // always null terminate 737 str[size-1] = '\0'; // always null terminate
743 return num_written; 738 return num_written;
744} 739}
740
741std::string ll_convert_wide_to_string(const wchar_t* in)
742{
743 std::string out;
744 if(in)
745 {
746 int len_in = wcslen(in);
747 int len_out = WideCharToMultiByte(
748 CP_ACP,
749 0,
750 in,
751 len_in,
752 NULL,
753 0,
754 0,
755 0);
756 // We will need two more bytes for the double NULL ending
757 // created in WideCharToMultiByte().
758 char* pout = new char [len_out + 2];
759 memset(pout, 0, len_out + 2);
760 if(pout)
761 {
762 WideCharToMultiByte(
763 CP_ACP,
764 0,
765 in,
766 len_in,
767 pout,
768 len_out,
769 0,
770 0);
771 out.assign(pout);
772 delete[] pout;
773 }
774 }
775 return out;
776}
745#endif // LL_WINDOWS 777#endif // LL_WINDOWS
746 778
747S32 LLStringOps::collate(const llwchar* a, const llwchar* b) 779S32 LLStringOps::collate(const llwchar* a, const llwchar* b)
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h
index 70f7d54..ae44ac3 100644
--- a/linden/indra/llcommon/llstring.h
+++ b/linden/indra/llcommon/llstring.h
@@ -481,7 +481,37 @@ std::ostream& operator<<(std::ostream &s, const LLStringBase<T> &str)
481std::ostream& operator<<(std::ostream &s, const LLWString &wstr); 481std::ostream& operator<<(std::ostream &s, const LLWString &wstr);
482 482
483#if LL_WINDOWS 483#if LL_WINDOWS
484int safe_snprintf(char *str, size_t size, const char *format, ...); 484/* @name Windows string helpers
485 */
486//@{
487
488/**
489 * @brief Implementation the expected snprintf interface.
490 *
491 * If the size of the passed in buffer is not large enough to hold the string,
492 * two bad things happen:
493 * 1. resulting formatted string is NOT null terminated
494 * 2. Depending on the platform, the return value could be a) the required
495 * size of the buffer to copy the entire formatted string or b) -1.
496 * On Windows with VS.Net 2003, it returns -1 e.g.
497 *
498 * safe_snprintf always adds a NULL terminator so that the caller does not
499 * need to check for return value or need to add the NULL terminator.
500 * It does not, however change the return value - to let the caller know
501 * that the passed in buffer size was not large enough to hold the
502 * formatted string.
503 *
504 */
505int safe_snprintf(char* str, size_t size, const char* format, ...);
506
507/**
508 * @brief Convert a wide string to std::string
509 *
510 * This replaces the unsafe W2A macro from ATL.
511 */
512std::string ll_convert_wide_to_string(const wchar_t* in);
513
514//@}
485#endif // LL_WINDOWS 515#endif // LL_WINDOWS
486 516
487/** 517/**
diff --git a/linden/indra/llcommon/llsys.cpp b/linden/indra/llcommon/llsys.cpp
index 3b57db7..7346b29 100644
--- a/linden/indra/llcommon/llsys.cpp
+++ b/linden/indra/llcommon/llsys.cpp
@@ -65,8 +65,7 @@ static const S32 CPUINFO_BUFFER_SIZE = 16383;
65LLCPUInfo gSysCPU; 65LLCPUInfo gSysCPU;
66 66
67LLOSInfo::LLOSInfo() : 67LLOSInfo::LLOSInfo() :
68 mMajorVer(0), mMinorVer(0), mBuild(0), 68 mMajorVer(0), mMinorVer(0), mBuild(0)
69 mOSString("")
70{ 69{
71 70
72#if LL_WINDOWS 71#if LL_WINDOWS
@@ -94,27 +93,28 @@ LLOSInfo::LLOSInfo() :
94 // Test for the product. 93 // Test for the product.
95 if(osvi.dwMajorVersion <= 4) 94 if(osvi.dwMajorVersion <= 4)
96 { 95 {
97 mOSString = "Microsoft Windows NT "; 96 mOSStringSimple = "Microsoft Windows NT ";
98 } 97 }
99 else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) 98 else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
100 { 99 {
101 mOSString = "Microsoft Windows 2000 "; 100 mOSStringSimple = "Microsoft Windows 2000 ";
102 } 101 }
103 else if(osvi.dwMajorVersion ==5 && osvi.dwMinorVersion == 1) 102 else if(osvi.dwMajorVersion ==5 && osvi.dwMinorVersion == 1)
104 { 103 {
105 mOSString = "Microsoft Windows XP "; 104 mOSStringSimple = "Microsoft Windows XP ";
106 } 105 }
107 else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) 106 else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
108 { 107 {
109 if(osvi.wProductType == VER_NT_WORKSTATION) 108 if(osvi.wProductType == VER_NT_WORKSTATION)
110 mOSString = "Microsoft Windows XP x64 Edition "; 109 mOSStringSimple = "Microsoft Windows XP x64 Edition ";
111 else mOSString = "Microsoft Windows Server 2003 "; 110 else
111 mOSStringSimple = "Microsoft Windows Server 2003 ";
112 } 112 }
113 else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) 113 else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
114 { 114 {
115 if(osvi.wProductType == VER_NT_WORKSTATION) 115 if(osvi.wProductType == VER_NT_WORKSTATION)
116 mOSString = "Microsoft Windows Vista "; 116 mOSStringSimple = "Microsoft Windows Vista ";
117 else mOSString = "Microsoft Windows Vista Server "; 117 else mOSStringSimple = "Microsoft Windows Vista Server ";
118 } 118 }
119 else // Use the registry on early versions of Windows NT. 119 else // Use the registry on early versions of Windows NT.
120 { 120 {
@@ -129,15 +129,15 @@ LLOSInfo::LLOSInfo() :
129 RegCloseKey( hKey ); 129 RegCloseKey( hKey );
130 if ( lstrcmpi( L"WINNT", szProductType) == 0 ) 130 if ( lstrcmpi( L"WINNT", szProductType) == 0 )
131 { 131 {
132 mOSString += "Professional "; 132 mOSStringSimple += "Professional ";
133 } 133 }
134 else if ( lstrcmpi( L"LANMANNT", szProductType) == 0 ) 134 else if ( lstrcmpi( L"LANMANNT", szProductType) == 0 )
135 { 135 {
136 mOSString += "Server "; 136 mOSStringSimple += "Server ";
137 } 137 }
138 else if ( lstrcmpi( L"SERVERNT", szProductType) == 0 ) 138 else if ( lstrcmpi( L"SERVERNT", szProductType) == 0 )
139 { 139 {
140 mOSString += "Advanced Server "; 140 mOSStringSimple += "Advanced Server ";
141 } 141 }
142 } 142 }
143 143
@@ -164,7 +164,7 @@ LLOSInfo::LLOSInfo() :
164 csdversion.c_str(), 164 csdversion.c_str(),
165 (osvi.dwBuildNumber & 0xffff)); 165 (osvi.dwBuildNumber & 0xffff));
166 } 166 }
167 mOSString += tmp; 167 mOSString = mOSStringSimple + tmp;
168 } 168 }
169 break; 169 break;
170 170
@@ -172,41 +172,65 @@ LLOSInfo::LLOSInfo() :
172 // Test for the Windows 95 product family. 172 // Test for the Windows 95 product family.
173 if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0) 173 if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
174 { 174 {
175 mOSString = "Microsoft Windows 95 "; 175 mOSStringSimple = "Microsoft Windows 95 ";
176 if ( osvi.szCSDVersion[1] == 'C' || osvi.szCSDVersion[1] == 'B' ) 176 if ( osvi.szCSDVersion[1] == 'C' || osvi.szCSDVersion[1] == 'B' )
177 { 177 {
178 mOSString += "OSR2 "; 178 mOSStringSimple += "OSR2 ";
179 } 179 }
180 } 180 }
181 if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10) 181 if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
182 { 182 {
183 mOSString = "Microsoft Windows 98 "; 183 mOSStringSimple = "Microsoft Windows 98 ";
184 if ( osvi.szCSDVersion[1] == 'A' ) 184 if ( osvi.szCSDVersion[1] == 'A' )
185 { 185 {
186 mOSString += "SE "; 186 mOSStringSimple += "SE ";
187 } 187 }
188 } 188 }
189 if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) 189 if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
190 { 190 {
191 mOSString = "Microsoft Windows Millennium Edition "; 191 mOSStringSimple = "Microsoft Windows Millennium Edition ";
192 } 192 }
193 mOSString = mOSStringSimple;
193 break; 194 break;
194 } 195 }
195#else 196#else
196 struct utsname un; 197 struct utsname un;
197 if(uname(&un) != -1) 198 if(uname(&un) != -1)
198 { 199 {
199 mOSString.append(un.sysname); 200 mOSStringSimple.append(un.sysname);
200 mOSString.append(" "); 201 mOSStringSimple.append(" ");
201 mOSString.append(un.release); 202 mOSStringSimple.append(un.release);
203
204 mOSString = mOSStringSimple;
202 mOSString.append(" "); 205 mOSString.append(" ");
203 mOSString.append(un.version); 206 mOSString.append(un.version);
204 mOSString.append(" "); 207 mOSString.append(" ");
205 mOSString.append(un.machine); 208 mOSString.append(un.machine);
209
210 // Simplify 'Simple'
211 std::string ostype = mOSStringSimple.substr(0, mOSStringSimple.find_first_of(" ", 0));
212 if (ostype == "Darwin")
213 {
214 // Only care about major Darwin versions, truncate at first '.'
215 S32 idx1 = mOSStringSimple.find_first_of(".", 0);
216 std::string simple = mOSStringSimple.substr(0, idx1);
217 if (simple.length() > 0)
218 mOSStringSimple = simple;
219 }
220 else if (ostype == "Linux")
221 {
222 // Only care about major and minor Linux versions, truncate at second '.'
223 S32 idx1 = mOSStringSimple.find_first_of(".", 0);
224 S32 idx2 = (idx1 != std::string::npos) ? mOSStringSimple.find_first_of(".", idx1+1) : std::string::npos;
225 std::string simple = mOSStringSimple.substr(0, idx2);
226 if (simple.length() > 0)
227 mOSStringSimple = simple;
228 }
206 } 229 }
207 else 230 else
208 { 231 {
209 mOSString.append("Unable to collect OS info"); 232 mOSStringSimple.append("Unable to collect OS info");
233 mOSString = mOSStringSimple;
210 } 234 }
211#endif 235#endif
212 236
@@ -255,6 +279,11 @@ const std::string& LLOSInfo::getOSString() const
255 return mOSString; 279 return mOSString;
256} 280}
257 281
282const std::string& LLOSInfo::getOSStringSimple() const
283{
284 return mOSStringSimple;
285}
286
258const S32 STATUS_SIZE = 8192; 287const S32 STATUS_SIZE = 8192;
259 288
260//static 289//static
diff --git a/linden/indra/llcommon/llsys.h b/linden/indra/llcommon/llsys.h
index fc4e027..332d62c 100644
--- a/linden/indra/llcommon/llsys.h
+++ b/linden/indra/llcommon/llsys.h
@@ -51,6 +51,7 @@ public:
51 void stream(std::ostream& s) const; 51 void stream(std::ostream& s) const;
52 52
53 const std::string& getOSString() const; 53 const std::string& getOSString() const;
54 const std::string& getOSStringSimple() const;
54 55
55 S32 mMajorVer; 56 S32 mMajorVer;
56 S32 mMinorVer; 57 S32 mMinorVer;
@@ -64,6 +65,7 @@ public:
64 static U32 getProcessResidentSizeKB(); 65 static U32 getProcessResidentSizeKB();
65private: 66private:
66 std::string mOSString; 67 std::string mOSString;
68 std::string mOSStringSimple;
67}; 69};
68 70
69 71
diff --git a/linden/indra/llcommon/lluri.cpp b/linden/indra/llcommon/lluri.cpp
index df79043..5e4dec7 100644
--- a/linden/indra/llcommon/lluri.cpp
+++ b/linden/indra/llcommon/lluri.cpp
@@ -40,6 +40,8 @@
40 40
41#include "../llmath/lluuid.h" 41#include "../llmath/lluuid.h"
42 42
43// system includes
44#include <boost/tokenizer.hpp>
43 45
44// static 46// static
45std::string LLURI::escape(const std::string& str, const std::string & allowed) 47std::string LLURI::escape(const std::string& str, const std::string & allowed)
@@ -130,7 +132,7 @@ LLURI::LLURI()
130 132
131LLURI::LLURI(const std::string& escaped_str) 133LLURI::LLURI(const std::string& escaped_str)
132{ 134{
133 std::string::size_type delim_pos, delim_pos2; 135 std::string::size_type delim_pos;
134 delim_pos = escaped_str.find(':'); 136 delim_pos = escaped_str.find(':');
135 std::string temp; 137 std::string temp;
136 if (delim_pos == std::string::npos) 138 if (delim_pos == std::string::npos)
@@ -144,13 +146,39 @@ LLURI::LLURI(const std::string& escaped_str)
144 mEscapedOpaque = escaped_str.substr(delim_pos+1); 146 mEscapedOpaque = escaped_str.substr(delim_pos+1);
145 } 147 }
146 148
147 if (mScheme == "http" || mScheme == "https" || mScheme == "ftp") 149 parseAuthorityAndPathUsingOpaque();
150
151 delim_pos = mEscapedPath.find('?');
152 if (delim_pos != std::string::npos)
153 {
154 mEscapedQuery = mEscapedPath.substr(delim_pos+1);
155 mEscapedPath = mEscapedPath.substr(0,delim_pos);
156 }
157}
158
159static BOOL isDefault(const std::string& scheme, U16 port)
160{
161 if (scheme == "http")
162 return port == 80;
163 if (scheme == "https")
164 return port == 443;
165 if (scheme == "ftp")
166 return port == 21;
167
168 return FALSE;
169}
170
171void LLURI::parseAuthorityAndPathUsingOpaque()
172{
173 if (mScheme == "http" || mScheme == "https" ||
174 mScheme == "ftp" || mScheme == "secondlife" )
148 { 175 {
149 if (mEscapedOpaque.substr(0,2) != "//") 176 if (mEscapedOpaque.substr(0,2) != "//")
150 { 177 {
151 return; 178 return;
152 } 179 }
153 180
181 std::string::size_type delim_pos, delim_pos2;
154 delim_pos = mEscapedOpaque.find('/', 2); 182 delim_pos = mEscapedOpaque.find('/', 2);
155 delim_pos2 = mEscapedOpaque.find('?', 2); 183 delim_pos2 = mEscapedOpaque.find('?', 2);
156 // no path, no query 184 // no path, no query
@@ -182,27 +210,12 @@ LLURI::LLURI(const std::string& escaped_str)
182 mEscapedPath = mEscapedOpaque.substr(delim_pos); 210 mEscapedPath = mEscapedOpaque.substr(delim_pos);
183 } 211 }
184 } 212 }
185 213 else if (mScheme == "about")
186 delim_pos = mEscapedPath.find('?');
187 if (delim_pos != std::string::npos)
188 { 214 {
189 mEscapedQuery = mEscapedPath.substr(delim_pos+1); 215 mEscapedPath = mEscapedOpaque;
190 mEscapedPath = mEscapedPath.substr(0,delim_pos);
191 } 216 }
192} 217}
193 218
194static BOOL isDefault(const std::string& scheme, U16 port)
195{
196 if (scheme == "http")
197 return port == 80;
198 if (scheme == "https")
199 return port == 443;
200 if (scheme == "ftp")
201 return port == 21;
202
203 return FALSE;
204}
205
206LLURI::LLURI(const std::string& scheme, 219LLURI::LLURI(const std::string& scheme,
207 const std::string& userName, 220 const std::string& userName,
208 const std::string& password, 221 const std::string& password,
@@ -440,6 +453,22 @@ std::string LLURI::path() const
440 return unescape(mEscapedPath); 453 return unescape(mEscapedPath);
441} 454}
442 455
456LLSD LLURI::pathArray() const
457{
458 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
459 boost::char_separator<char> sep("/", "", boost::drop_empty_tokens);
460 tokenizer tokens(mEscapedPath, sep);
461 tokenizer::iterator it = tokens.begin();
462 tokenizer::iterator end = tokens.end();
463
464 LLSD params;
465 for ( ; it != end; ++it)
466 {
467 params.append(*it);
468 }
469 return params;
470}
471
443std::string LLURI::query() const 472std::string LLURI::query() const
444{ 473{
445 return unescape(mEscapedQuery); 474 return unescape(mEscapedQuery);
diff --git a/linden/indra/llcommon/lluri.h b/linden/indra/llcommon/lluri.h
index 3246dcd..bfe673c 100644
--- a/linden/indra/llcommon/lluri.h
+++ b/linden/indra/llcommon/lluri.h
@@ -107,7 +107,7 @@ public:
107 BOOL defaultPort() const; // true if port is default for scheme 107 BOOL defaultPort() const; // true if port is default for scheme
108 const std::string& escapedPath() const { return mEscapedPath; } 108 const std::string& escapedPath() const { return mEscapedPath; }
109 std::string path() const; // ex.: "/abc/def", includes leading slash 109 std::string path() const; // ex.: "/abc/def", includes leading slash
110 // LLSD pathArray() const; // above decoded into an array of strings 110 LLSD pathArray() const; // above decoded into an array of strings
111 std::string query() const; // ex.: "x=34", section after "?" 111 std::string query() const; // ex.: "x=34", section after "?"
112 const std::string& escapedQuery() const { return mEscapedQuery; } 112 const std::string& escapedQuery() const { return mEscapedQuery; }
113 LLSD queryMap() const; // above decoded into a map 113 LLSD queryMap() const; // above decoded into a map
@@ -135,6 +135,11 @@ public:
135 //@} 135 //@}
136 136
137private: 137private:
138 // only "http", "https", "ftp", and "secondlife" schemes are parsed
139 // secondlife scheme parses authority as "" and includes it as part of
140 // the path. See lluri_tut.cpp
141 // i.e. secondlife://app/login has mAuthority = "" and mPath = "/app/login"
142 void parseAuthorityAndPathUsingOpaque();
138 std::string mScheme; 143 std::string mScheme;
139 std::string mEscapedOpaque; 144 std::string mEscapedOpaque;
140 std::string mEscapedAuthority; 145 std::string mEscapedAuthority;
diff --git a/linden/indra/llcommon/llversionserver.h b/linden/indra/llcommon/llversionserver.h
index e36702a..9e1a8f5 100644
--- a/linden/indra/llcommon/llversionserver.h
+++ b/linden/indra/llcommon/llversionserver.h
@@ -34,8 +34,8 @@
34 34
35const S32 LL_VERSION_MAJOR = 1; 35const S32 LL_VERSION_MAJOR = 1;
36const S32 LL_VERSION_MINOR = 18; 36const S32 LL_VERSION_MINOR = 18;
37const S32 LL_VERSION_PATCH = 3; 37const S32 LL_VERSION_PATCH = 6;
38const S32 LL_VERSION_BUILD = 73552; 38const S32 LL_VERSION_BUILD = 74522;
39 39
40const char * const LL_CHANNEL = "Second Life Server"; 40const char * const LL_CHANNEL = "Second Life Server";
41 41
diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h
index 1df8a89..f9f3bf2 100644
--- a/linden/indra/llcommon/llversionviewer.h
+++ b/linden/indra/llcommon/llversionviewer.h
@@ -34,8 +34,8 @@
34 34
35const S32 LL_VERSION_MAJOR = 1; 35const S32 LL_VERSION_MAJOR = 1;
36const S32 LL_VERSION_MINOR = 18; 36const S32 LL_VERSION_MINOR = 18;
37const S32 LL_VERSION_PATCH = 5; 37const S32 LL_VERSION_PATCH = 6;
38const S32 LL_VERSION_BUILD = 3; 38const S32 LL_VERSION_BUILD = 0;
39 39
40const char * const LL_CHANNEL = "Second Life Release"; 40const char * const LL_CHANNEL = "Second Life Release";
41 41