diff options
author | Aaron Brashears <aaronb@lindenlab.com> | 2008-02-08 23:43:16 +0000 |
---|---|---|
committer | Aaron Brashears <aaronb@lindenlab.com> | 2008-02-08 23:43:16 +0000 |
commit | 446b7ecea2e1635bd66087894f23e3a45eb7b607 (patch) | |
tree | 7727e7cca1f4b75f55a722ca48808db8fd2ec947 /indra/llmessage | |
parent | 8bd6a0b3217ea5614d2a29195e528aa8314f6342 (diff) |
Result of svn merge -r79554:79558 svn+ssh://svn/svn/linden/branches/merge-dp into release
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llhost.cpp | 12 | ||||
-rw-r--r-- | indra/llmessage/llhost.h | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp index b73becfa71..4d10f06051 100644 --- a/indra/llmessage/llhost.cpp +++ b/indra/llmessage/llhost.cpp @@ -132,14 +132,13 @@ void LLHost::getHostName(char *buf, S32 len) const } } -LLString LLHost::getHostName() const +std::string LLHost::getHostName() const { - hostent *he; - + hostent* he; if (INVALID_HOST_IP_ADDRESS == mIP) { llwarns << "LLHost::getHostName() : Invalid IP address" << llendl; - return ""; + return std::string(); } he = gethostbyaddr((char *)&mIP, sizeof(mIP), AF_INET); if (!he) @@ -151,12 +150,11 @@ LLString LLHost::getHostName() const llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " << h_errno << llendl; #endif - return ""; + return std::string(); } else { - LLString hostname = he->h_name; - return hostname; + return ll_safe_string(he->h_name); } } diff --git a/indra/llmessage/llhost.h b/indra/llmessage/llhost.h index e6f811ac08..a865ad616c 100644 --- a/indra/llmessage/llhost.h +++ b/indra/llmessage/llhost.h @@ -38,8 +38,6 @@ #include "net.h" -#include "llstring.h" - const U32 INVALID_PORT = 0; const U32 INVALID_HOST_IP_ADDRESS = 0x0; @@ -102,7 +100,7 @@ public: void getIPString(char* buffer, S32 length) const; // writes IP into buffer std::string getIPString() const; void getHostName(char *buf, S32 len) const; - LLString getHostName() const; + std::string getHostName() const; std::string getIPandPort() const; friend std::ostream& operator<< (std::ostream& os, const LLHost &hh); |