Ignore:
Timestamp:
21/08/2008 12:04:21 (4 years ago)
Author:
chris
Message:

Make Open() take a const std::string& for the socket name instead of a
const char *, for C++ style.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/server/Socket.cpp

    r1783 r2253  
    3838// 
    3939// -------------------------------------------------------------------------- 
    40 void Socket::NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain, int Type, const char *Name, int Port, int &rSockAddrLenOut) 
     40void Socket::NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain, 
     41        int Type, const std::string& rName, int Port, int &rSockAddrLenOut) 
    4142{ 
    4243        int sockAddrLen = 0; 
     
    4849                { 
    4950                        // Lookup hostname 
    50                         struct hostent *phost = ::gethostbyname(Name); 
     51                        struct hostent *phost = ::gethostbyname(rName.c_str()); 
    5152                        if(phost != NULL) 
    5253                        { 
     
    8283                { 
    8384                        // Check length of name is OK 
    84                         unsigned int nameLen = ::strlen(Name); 
     85                        unsigned int nameLen = rName.length(); 
    8586                        if(nameLen >= (sizeof(addr.sa_unix.sun_path) - 1)) 
    8687                        { 
     
    9293#endif 
    9394                        addr.sa_unix.sun_family = PF_UNIX; 
    94                         ::strcpy(addr.sa_unix.sun_path, Name); 
     95                        ::strcpy(addr.sa_unix.sun_path, rName.c_str()); 
    9596                } 
    9697                break; 
Note: See TracChangeset for help on using the changeset viewer.