Ignore:
Timestamp:
Feb 24, 2003, 12:14:56 PM (23 years ago)
Author:
sandervl
Message:

check for local host name in gethostbyname. if identical, then use localhost instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/wsock32.cpp

    r9817 r9844  
    1 /* $Id: wsock32.cpp,v 1.50 2003-02-17 12:27:28 sandervl Exp $ */
     1/* $Id: wsock32.cpp,v 1.51 2003-02-24 11:14:56 sandervl Exp $ */
    22
    33/*
     
    14921492  if( pwsi )
    14931493  {
    1494     struct hostent*     host;
    1495    
     1494    struct hostent* host;
     1495    char            localhostname[256];
     1496
    14961497    dprintf(("gethostbyname %s", name));
     1498    if(gethostname(localhostname, sizeof(localhostname)) == NO_ERROR)
     1499    {
     1500        if(!strcmp(name, localhostname)) {
     1501            strcpy(localhostname, "localhost");
     1502            name = localhostname;
     1503            dprintf(("using localhost"));
     1504        }
     1505    }
    14971506
    14981507    host = gethostbyname( (char*) name);
Note: See TracChangeset for help on using the changeset viewer.