mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
special case localhost = 127.0.0.1 (for now)
This commit is contained in:
parent
60d44a675a
commit
5cad0d6a80
@ -27,7 +27,7 @@ namespace SockTests {
|
|||||||
class HostByName {
|
class HostByName {
|
||||||
public:
|
public:
|
||||||
void run() {
|
void run() {
|
||||||
ASSERT( hostbyname( "localhost" ) == "127.0.0.1" || hostbyname( "localhost" ) == "::1" );
|
ASSERT_EQUALS( "127.0.0.1", hostbyname( "localhost" ) );
|
||||||
ASSERT_EQUALS( "127.0.0.1", hostbyname( "127.0.0.1" ) );
|
ASSERT_EQUALS( "127.0.0.1", hostbyname( "127.0.0.1" ) );
|
||||||
ASSERT_EQUALS( "::1", hostbyname( "::1" ) );
|
ASSERT_EQUALS( "::1", hostbyname( "::1" ) );
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,9 @@ namespace mongo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SockAddr::SockAddr(const char * iporhost , int port) {
|
SockAddr::SockAddr(const char * iporhost , int port) {
|
||||||
|
if (!strcmp(iporhost, "localhost"))
|
||||||
|
iporhost = "127.0.0.1";
|
||||||
|
|
||||||
if (strchr(iporhost, '/')){
|
if (strchr(iporhost, '/')){
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
uassert(13080, "no unix socket support on windows", false);
|
uassert(13080, "no unix socket support on windows", false);
|
||||||
|
Loading…
Reference in New Issue
Block a user