From 06e1a321877541dcd6be5eee469627c682ecaa2d Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 9 Nov 2003 01:47:00 +0000 Subject: [PATCH] Use gethostbyaddr_r/gethostbyname_r buffer size as recommended in UNIX Network Programming vol. 1. --- asio/include/asio/inet_address_v4.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asio/include/asio/inet_address_v4.hpp b/asio/include/asio/inet_address_v4.hpp index 18629b3c..e1fa10c5 100644 --- a/asio/include/asio/inet_address_v4.hpp +++ b/asio/include/asio/inet_address_v4.hpp @@ -174,7 +174,7 @@ public: std::string host_name() const { hostent ent; - char buf[1024] = ""; + char buf[8192] = ""; // Size recommended by Stevens, UNPv1. int error = 0; if (detail::socket_ops::gethostbyaddr_r( reinterpret_cast(&addr_.sin_addr), @@ -189,7 +189,7 @@ public: { using namespace std; // For memcpy. hostent ent; - char buf[1024] = ""; + char buf[8192] = ""; // Size recommended by Stevens, UNPv1. int error = 0; if (detail::socket_ops::gethostbyname_r(host.c_str(), &ent, buf, sizeof(buf), &error) == 0)