summaryrefslogtreecommitdiffstats
path: root/net/base/net_util.cc
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 18:00:00 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 18:00:00 +0000
commit43f0aaeb568fd974d442dd088f0d0036f8e1a61f (patch)
treedc4fba8446b24d4772d558af03871322528e5ddc /net/base/net_util.cc
parentcc424a3d6b39e80dfabd683c2e9a7f79db890fe8 (diff)
downloadchromium_src-43f0aaeb568fd974d442dd088f0d0036f8e1a61f.zip
chromium_src-43f0aaeb568fd974d442dd088f0d0036f8e1a61f.tar.gz
chromium_src-43f0aaeb568fd974d442dd088f0d0036f8e1a61f.tar.bz2
GetMyHostName is renamed GetHostName to match the name of
the Unix/Winsock function gethostname. R=eroman Review URL: http://codereview.chromium.org/42590 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.cc')
-rw-r--r--net/base/net_util.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 6171db3..7865b4e 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1024,13 +1024,12 @@ std::string NetAddressToString(const struct addrinfo* net_address) {
return std::string(buffer);
}
-std::string GetMyHostName() {
+std::string GetHostName() {
#if defined(OS_WIN)
EnsureWinsockInit();
#endif
- // Maximum size of 256 is somewhat arbitrary. Mozilla uses a size of 100
- // so this should cover the majority of cases.
+ // Host names are limited to 255 bytes.
char buffer[256];
int result = gethostname(buffer, sizeof(buffer));
if (result != 0) {