diff options
Diffstat (limited to 'linden/indra/newview/llsrv.h')
-rw-r--r-- | linden/indra/newview/llsrv.h | 48 |
1 files changed, 4 insertions, 44 deletions
diff --git a/linden/indra/newview/llsrv.h b/linden/indra/newview/llsrv.h index 9417664..28bc36a 100644 --- a/linden/indra/newview/llsrv.h +++ b/linden/indra/newview/llsrv.h | |||
@@ -2,7 +2,9 @@ | |||
2 | * @file llsrv.h | 2 | * @file llsrv.h |
3 | * @brief Wrapper for DNS SRV record lookups | 3 | * @brief Wrapper for DNS SRV record lookups |
4 | * | 4 | * |
5 | * Copyright (c) 2007-2007, Linden Research, Inc. | 5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | ||
7 | * Copyright (c) 2007, Linden Research, Inc. | ||
6 | * | 8 | * |
7 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
8 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -24,57 +26,15 @@ | |||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
26 | * COMPLETENESS OR PERFORMANCE. | 28 | * COMPLETENESS OR PERFORMANCE. |
29 | * $/LicenseInfo$ | ||
27 | */ | 30 | */ |
28 | 31 | ||
29 | #ifndef LL_LLSRV_H | 32 | #ifndef LL_LLSRV_H |
30 | #define LL_LLSRV_H | 33 | #define LL_LLSRV_H |
31 | 34 | ||
32 | class LLSRV; | ||
33 | |||
34 | class LLSRVRecord | ||
35 | { | ||
36 | friend class LLSRV; | ||
37 | |||
38 | protected: | ||
39 | U16 mPriority; | ||
40 | U16 mWeight; | ||
41 | std::string mTarget; | ||
42 | U16 mPort; | ||
43 | |||
44 | public: | ||
45 | LLSRVRecord(U16 priority, U16 weight, const std::string& target, | ||
46 | U16 port) : | ||
47 | mPriority(priority), | ||
48 | mWeight(weight), | ||
49 | mTarget(target), | ||
50 | mPort(port) { | ||
51 | } | ||
52 | |||
53 | U16 priority() const { return mPriority; } | ||
54 | U16 weight() const { return mWeight; } | ||
55 | const std::string& target() const { return mTarget; } | ||
56 | U16 port() const { return mPort; } | ||
57 | |||
58 | struct ComparePriorityLowest | ||
59 | { | ||
60 | bool operator()(const LLSRVRecord& lhs, const LLSRVRecord& rhs) | ||
61 | { | ||
62 | return lhs.mPriority < rhs.mPriority; | ||
63 | } | ||
64 | }; | ||
65 | }; | ||
66 | |||
67 | class LLSRV | 35 | class LLSRV |
68 | { | 36 | { |
69 | protected: | ||
70 | #ifndef LL_WINDOWS | ||
71 | static std::vector<LLSRVRecord> parseResponse(const unsigned char *response, | ||
72 | int resp_len); | ||
73 | #endif | ||
74 | static std::vector<LLSRVRecord> reorder(std::vector<LLSRVRecord>& recs); | ||
75 | |||
76 | public: | 37 | public: |
77 | static std::vector<LLSRVRecord> query(const std::string& name); | ||
78 | static std::vector<std::string> rewriteURI(const std::string& uri); | 38 | static std::vector<std::string> rewriteURI(const std::string& uri); |
79 | }; | 39 | }; |
80 | 40 | ||