diff options
Diffstat (limited to 'linden/indra/llmessage/llhost.h')
-rw-r--r-- | linden/indra/llmessage/llhost.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/linden/indra/llmessage/llhost.h b/linden/indra/llmessage/llhost.h index 0b3afe8..819e7ca 100644 --- a/linden/indra/llmessage/llhost.h +++ b/linden/indra/llmessage/llhost.h | |||
@@ -61,10 +61,10 @@ public: | |||
61 | mIP = ipv4_addr; | 61 | mIP = ipv4_addr; |
62 | } | 62 | } |
63 | 63 | ||
64 | LLHost( const char *ipv4_addr, U32 port ) | 64 | LLHost( const std::string& ipv4_addr, U32 port ) |
65 | : mPort( port ) | 65 | : mPort( port ) |
66 | { | 66 | { |
67 | mIP = ip_string_to_u32(ipv4_addr); | 67 | mIP = ip_string_to_u32(ipv4_addr.c_str()); |
68 | } | 68 | } |
69 | 69 | ||
70 | explicit LLHost(const U64 ip_port) | 70 | explicit LLHost(const U64 ip_port) |
@@ -82,11 +82,11 @@ public: | |||
82 | 82 | ||
83 | // MANIPULATORS | 83 | // MANIPULATORS |
84 | void set( U32 ip, U32 port ) { mIP = ip; mPort = port; } | 84 | void set( U32 ip, U32 port ) { mIP = ip; mPort = port; } |
85 | void set( const char* ipstr, U32 port ) { mIP = ip_string_to_u32(ipstr); mPort = port; } | 85 | void set( const std::string& ipstr, U32 port ) { mIP = ip_string_to_u32(ipstr.c_str()); mPort = port; } |
86 | void setAddress( const char* ipstr ) { mIP = ip_string_to_u32(ipstr); } | 86 | void setAddress( const std::string& ipstr ) { mIP = ip_string_to_u32(ipstr.c_str()); } |
87 | void setAddress( U32 ip ) { mIP = ip; } | 87 | void setAddress( U32 ip ) { mIP = ip; } |
88 | void setPort( U32 port ) { mPort = port; } | 88 | void setPort( U32 port ) { mPort = port; } |
89 | BOOL setHostByName(const char *hname); | 89 | BOOL setHostByName(const std::string& hname); |
90 | 90 | ||
91 | LLHost& operator=(const LLHost &rhs); | 91 | LLHost& operator=(const LLHost &rhs); |
92 | void invalidate() { mIP = INVALID_HOST_IP_ADDRESS; mPort = INVALID_PORT;}; | 92 | void invalidate() { mIP = INVALID_HOST_IP_ADDRESS; mPort = INVALID_PORT;}; |
@@ -96,10 +96,8 @@ public: | |||
96 | U32 getPort() const { return mPort; } | 96 | U32 getPort() const { return mPort; } |
97 | BOOL isOk() const { return (mIP != INVALID_HOST_IP_ADDRESS) && (mPort != INVALID_PORT); } | 97 | BOOL isOk() const { return (mIP != INVALID_HOST_IP_ADDRESS) && (mPort != INVALID_PORT); } |
98 | size_t hash() const { return (mIP << 16) | (mPort & 0xffff); } | 98 | size_t hash() const { return (mIP << 16) | (mPort & 0xffff); } |
99 | void getString(char* buffer, S32 length) const; // writes IP:port into buffer | 99 | std::string getString() const; |
100 | void getIPString(char* buffer, S32 length) const; // writes IP into buffer | ||
101 | std::string getIPString() const; | 100 | std::string getIPString() const; |
102 | void getHostName(char *buf, S32 len) const; | ||
103 | std::string getHostName() const; | 101 | std::string getHostName() const; |
104 | std::string getIPandPort() const; | 102 | std::string getIPandPort() const; |
105 | 103 | ||