diff options
author | Jacek Antonelli | 2008-09-28 17:21:23 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-28 17:21:46 -0500 |
commit | 31e7c77a411d94bc87f0232588b339149bb29a49 (patch) | |
tree | 49e487700e91713e620e4d33f20b7f7afb5a2fa9 /linden/indra/llcommon | |
parent | Second Life viewer sources 1.21.2-RC (diff) | |
download | meta-impy-31e7c77a411d94bc87f0232588b339149bb29a49.zip meta-impy-31e7c77a411d94bc87f0232588b339149bb29a49.tar.gz meta-impy-31e7c77a411d94bc87f0232588b339149bb29a49.tar.bz2 meta-impy-31e7c77a411d94bc87f0232588b339149bb29a49.tar.xz |
Second Life viewer sources 1.21.3-RC
Diffstat (limited to 'linden/indra/llcommon')
-rw-r--r-- | linden/indra/llcommon/CMakeLists.txt | 1 | ||||
-rw-r--r-- | linden/indra/llcommon/linden_common.h | 8 | ||||
-rw-r--r-- | linden/indra/llcommon/llhttpstatuscodes.h | 94 | ||||
-rw-r--r-- | linden/indra/llcommon/llstring.h | 31 | ||||
-rw-r--r-- | linden/indra/llcommon/llversionviewer.h | 2 |
5 files changed, 120 insertions, 16 deletions
diff --git a/linden/indra/llcommon/CMakeLists.txt b/linden/indra/llcommon/CMakeLists.txt index 72d267d..8810549 100644 --- a/linden/indra/llcommon/CMakeLists.txt +++ b/linden/indra/llcommon/CMakeLists.txt | |||
@@ -114,6 +114,7 @@ set(llcommon_HEADER_FILES | |||
114 | llframetimer.h | 114 | llframetimer.h |
115 | llhash.h | 115 | llhash.h |
116 | llheartbeat.h | 116 | llheartbeat.h |
117 | llhttpstatuscodes.h | ||
117 | llindexedqueue.h | 118 | llindexedqueue.h |
118 | llindraconfigfile.h | 119 | llindraconfigfile.h |
119 | llkeythrottle.h | 120 | llkeythrottle.h |
diff --git a/linden/indra/llcommon/linden_common.h b/linden/indra/llcommon/linden_common.h index 827ec8f..fc34a92 100644 --- a/linden/indra/llcommon/linden_common.h +++ b/linden/indra/llcommon/linden_common.h | |||
@@ -33,9 +33,11 @@ | |||
33 | #define LL_LINDEN_COMMON_H | 33 | #define LL_LINDEN_COMMON_H |
34 | 34 | ||
35 | #if defined(LL_WINDOWS) && defined(_DEBUG) | 35 | #if defined(LL_WINDOWS) && defined(_DEBUG) |
36 | # define _CRTDBG_MAP_ALLOC | 36 | # if _MSC_VER >= 1400 // Visual C++ 2005 or later |
37 | # include <stdlib.h> | 37 | # define _CRTDBG_MAP_ALLOC |
38 | # include <crtdbg.h> | 38 | # include <stdlib.h> |
39 | # include <crtdbg.h> | ||
40 | # endif | ||
39 | #endif | 41 | #endif |
40 | 42 | ||
41 | #include "llpreprocessor.h" | 43 | #include "llpreprocessor.h" |
diff --git a/linden/indra/llcommon/llhttpstatuscodes.h b/linden/indra/llcommon/llhttpstatuscodes.h new file mode 100644 index 0000000..2eb1c39 --- /dev/null +++ b/linden/indra/llcommon/llhttpstatuscodes.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /** | ||
2 | * @file llhttpstatuscodes.h | ||
3 | * @brief Constants for HTTP status codes | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #ifndef LL_HTTP_STATUS_CODES_H | ||
33 | #define LL_HTTP_STATUS_CODES_H | ||
34 | |||
35 | #include "stdtypes.h" | ||
36 | |||
37 | // Standard errors from HTTP spec: | ||
38 | // http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1 | ||
39 | const S32 HTTP_CONTINUE = 100; | ||
40 | const S32 HTTP_SWITCHING_PROTOCOLS = 101; | ||
41 | |||
42 | // Success | ||
43 | const S32 HTTP_OK = 200; | ||
44 | const S32 HTTP_CREATED = 201; | ||
45 | const S32 HTTP_ACCEPTED = 202; | ||
46 | const S32 HTTP_NON_AUTHORITATIVE_INFORMATION = 203; | ||
47 | const S32 HTTP_NO_CONTENT = 204; | ||
48 | const S32 HTTP_RESET_CONTENT = 205; | ||
49 | const S32 HTTP_PARTIAL_CONTENT = 206; | ||
50 | |||
51 | // Redirection | ||
52 | const S32 HTTP_MULTIPLE_CHOICES = 300; | ||
53 | const S32 HTTP_MOVED_PERMANENTLY = 301; | ||
54 | const S32 HTTP_FOUND = 302; | ||
55 | const S32 HTTP_SEE_OTHER = 303; | ||
56 | const S32 HTTP_NOT_MODIFIED = 304; | ||
57 | const S32 HTTP_USE_PROXY = 305; | ||
58 | const S32 HTTP_TEMPORARY_REDIRECT = 307; | ||
59 | |||
60 | // Client Error | ||
61 | const S32 HTTP_BAD_REQUEST = 400; | ||
62 | const S32 HTTP_UNAUTHORIZED = 401; | ||
63 | const S32 HTTP_PAYMENT_REQUIRED = 402; | ||
64 | const S32 HTTP_FORBIDDEN = 403; | ||
65 | const S32 HTTP_NOT_FOUND = 404; | ||
66 | const S32 HTTP_METHOD_NOT_ALLOWED = 405; | ||
67 | const S32 HTTP_NOT_ACCEPTABLE = 406; | ||
68 | const S32 HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; | ||
69 | const S32 HTTP_REQUEST_TIME_OUT = 408; | ||
70 | const S32 HTTP_CONFLICT = 409; | ||
71 | const S32 HTTP_GONE = 410; | ||
72 | const S32 HTTP_LENGTH_REQUIRED = 411; | ||
73 | const S32 HTTP_PRECONDITION_FAILED = 412; | ||
74 | const S32 HTTP_REQUEST_ENTITY_TOO_LARGE = 413; | ||
75 | const S32 HTTP_REQUEST_URI_TOO_LARGE = 414; | ||
76 | const S32 HTTP_UNSUPPORTED_MEDIA_TYPE = 415; | ||
77 | const S32 HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; | ||
78 | const S32 HTTP_EXPECTATION_FAILED = 417; | ||
79 | |||
80 | // Server Error | ||
81 | const S32 HTTP_INTERNAL_SERVER_ERROR = 500; | ||
82 | const S32 HTTP_NOT_IMPLEMENTED = 501; | ||
83 | const S32 HTTP_BAD_GATEWAY = 502; | ||
84 | const S32 HTTP_SERVICE_UNAVAILABLE = 503; | ||
85 | const S32 HTTP_GATEWAY_TIME_OUT = 504; | ||
86 | const S32 HTTP_VERSION_NOT_SUPPORTED = 505; | ||
87 | |||
88 | // We combine internal process errors with status codes | ||
89 | // These status codes should not be sent over the wire | ||
90 | // and indicate something went wrong internally. | ||
91 | // If you get these they are not normal. | ||
92 | const S32 HTTP_INTERNAL_ERROR = 499; | ||
93 | |||
94 | #endif | ||
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h index 60a4492..7b08fd3 100644 --- a/linden/indra/llcommon/llstring.h +++ b/linden/indra/llcommon/llstring.h | |||
@@ -155,14 +155,28 @@ public: | |||
155 | static BOOL isDigit(llwchar a) { return iswdigit(a) != 0; } | 155 | static BOOL isDigit(llwchar a) { return iswdigit(a) != 0; } |
156 | }; | 156 | }; |
157 | 157 | ||
158 | /** | ||
159 | * @brief Return a string constructed from in without crashing if the | ||
160 | * pointer is NULL. | ||
161 | */ | ||
162 | std::string ll_safe_string(const char* in); | ||
163 | std::string ll_safe_string(const char* in, S32 maxlen); | ||
164 | |||
165 | |||
158 | // Allowing assignments from non-strings into format_map_t is apparently | 166 | // Allowing assignments from non-strings into format_map_t is apparently |
159 | // *really* error-prone, so subclass std::string with just basic c'tors. | 167 | // *really* error-prone, so subclass std::string with just basic c'tors. |
160 | class FormatMapString : public std::string | 168 | class LLFormatMapString |
161 | { | 169 | { |
162 | public: | 170 | public: |
163 | FormatMapString() : std::string() {}; | 171 | LLFormatMapString() {}; |
164 | FormatMapString(const char* s) : std::string(s) {}; | 172 | LLFormatMapString(const char* s) : mString(ll_safe_string(s)) {}; |
165 | FormatMapString(const std::string& s) : std::string(s) {}; | 173 | LLFormatMapString(const std::string& s) : mString(s) {}; |
174 | operator std::string() const { return mString; } | ||
175 | bool operator<(const LLFormatMapString& rhs) const { return mString < rhs.mString; } | ||
176 | std::size_t length() const { return mString.length(); } | ||
177 | |||
178 | private: | ||
179 | std::string mString; | ||
166 | }; | 180 | }; |
167 | 181 | ||
168 | template <class T> | 182 | template <class T> |
@@ -177,7 +191,7 @@ public: | |||
177 | 191 | ||
178 | static std::basic_string<T> null; | 192 | static std::basic_string<T> null; |
179 | 193 | ||
180 | typedef std::map<FormatMapString, FormatMapString> format_map_t; | 194 | typedef std::map<LLFormatMapString, LLFormatMapString> format_map_t; |
181 | static S32 format(std::basic_string<T>& s, const format_map_t& fmt_map); | 195 | static S32 format(std::basic_string<T>& s, const format_map_t& fmt_map); |
182 | 196 | ||
183 | static BOOL isValidIndex(const std::basic_string<T>& string, size_type i) | 197 | static BOOL isValidIndex(const std::basic_string<T>& string, size_type i) |
@@ -312,13 +326,6 @@ inline std::string chop_tail_copy( | |||
312 | } | 326 | } |
313 | 327 | ||
314 | /** | 328 | /** |
315 | * @brief Return a string constructed from in without crashing if the | ||
316 | * pointer is NULL. | ||
317 | */ | ||
318 | std::string ll_safe_string(const char* in); | ||
319 | std::string ll_safe_string(const char* in, S32 maxlen); | ||
320 | |||
321 | /** | ||
322 | * @brief This translates a nybble stored as a hex value from 0-f back | 329 | * @brief This translates a nybble stored as a hex value from 0-f back |
323 | * to a nybble in the low order bits of the return byte. | 330 | * to a nybble in the low order bits of the return byte. |
324 | */ | 331 | */ |
diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h index f357b76..e3e74b5 100644 --- a/linden/indra/llcommon/llversionviewer.h +++ b/linden/indra/llcommon/llversionviewer.h | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | const S32 LL_VERSION_MAJOR = 1; | 35 | const S32 LL_VERSION_MAJOR = 1; |
36 | const S32 LL_VERSION_MINOR = 21; | 36 | const S32 LL_VERSION_MINOR = 21; |
37 | const S32 LL_VERSION_PATCH = 2; | 37 | const S32 LL_VERSION_PATCH = 3; |
38 | const S32 LL_VERSION_BUILD = 0; | 38 | const S32 LL_VERSION_BUILD = 0; |
39 | 39 | ||
40 | const char * const LL_CHANNEL = "Second Life Release"; | 40 | const char * const LL_CHANNEL = "Second Life Release"; |