aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-28 17:21:23 -0500
committerJacek Antonelli2008-09-28 17:21:46 -0500
commit31e7c77a411d94bc87f0232588b339149bb29a49 (patch)
tree49e487700e91713e620e4d33f20b7f7afb5a2fa9 /linden/indra/llcommon
parentSecond Life viewer sources 1.21.2-RC (diff)
downloadmeta-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.txt1
-rw-r--r--linden/indra/llcommon/linden_common.h8
-rw-r--r--linden/indra/llcommon/llhttpstatuscodes.h94
-rw-r--r--linden/indra/llcommon/llstring.h31
-rw-r--r--linden/indra/llcommon/llversionviewer.h2
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
39const S32 HTTP_CONTINUE = 100;
40const S32 HTTP_SWITCHING_PROTOCOLS = 101;
41
42// Success
43const S32 HTTP_OK = 200;
44const S32 HTTP_CREATED = 201;
45const S32 HTTP_ACCEPTED = 202;
46const S32 HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
47const S32 HTTP_NO_CONTENT = 204;
48const S32 HTTP_RESET_CONTENT = 205;
49const S32 HTTP_PARTIAL_CONTENT = 206;
50
51// Redirection
52const S32 HTTP_MULTIPLE_CHOICES = 300;
53const S32 HTTP_MOVED_PERMANENTLY = 301;
54const S32 HTTP_FOUND = 302;
55const S32 HTTP_SEE_OTHER = 303;
56const S32 HTTP_NOT_MODIFIED = 304;
57const S32 HTTP_USE_PROXY = 305;
58const S32 HTTP_TEMPORARY_REDIRECT = 307;
59
60// Client Error
61const S32 HTTP_BAD_REQUEST = 400;
62const S32 HTTP_UNAUTHORIZED = 401;
63const S32 HTTP_PAYMENT_REQUIRED = 402;
64const S32 HTTP_FORBIDDEN = 403;
65const S32 HTTP_NOT_FOUND = 404;
66const S32 HTTP_METHOD_NOT_ALLOWED = 405;
67const S32 HTTP_NOT_ACCEPTABLE = 406;
68const S32 HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
69const S32 HTTP_REQUEST_TIME_OUT = 408;
70const S32 HTTP_CONFLICT = 409;
71const S32 HTTP_GONE = 410;
72const S32 HTTP_LENGTH_REQUIRED = 411;
73const S32 HTTP_PRECONDITION_FAILED = 412;
74const S32 HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
75const S32 HTTP_REQUEST_URI_TOO_LARGE = 414;
76const S32 HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
77const S32 HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
78const S32 HTTP_EXPECTATION_FAILED = 417;
79
80// Server Error
81const S32 HTTP_INTERNAL_SERVER_ERROR = 500;
82const S32 HTTP_NOT_IMPLEMENTED = 501;
83const S32 HTTP_BAD_GATEWAY = 502;
84const S32 HTTP_SERVICE_UNAVAILABLE = 503;
85const S32 HTTP_GATEWAY_TIME_OUT = 504;
86const 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.
92const 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 */
162std::string ll_safe_string(const char* in);
163std::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.
160class FormatMapString : public std::string 168class LLFormatMapString
161{ 169{
162public: 170public:
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
178private:
179 std::string mString;
166}; 180};
167 181
168template <class T> 182template <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 */
318std::string ll_safe_string(const char* in);
319std::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
35const S32 LL_VERSION_MAJOR = 1; 35const S32 LL_VERSION_MAJOR = 1;
36const S32 LL_VERSION_MINOR = 21; 36const S32 LL_VERSION_MINOR = 21;
37const S32 LL_VERSION_PATCH = 2; 37const S32 LL_VERSION_PATCH = 3;
38const S32 LL_VERSION_BUILD = 0; 38const S32 LL_VERSION_BUILD = 0;
39 39
40const char * const LL_CHANNEL = "Second Life Release"; 40const char * const LL_CHANNEL = "Second Life Release";