Changeset 2253 for box/trunk/lib/server/Socket.cpp
- Timestamp:
- 21/08/2008 12:04:21 (4 years ago)
- File:
-
- 1 edited
-
box/trunk/lib/server/Socket.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/server/Socket.cpp
r1783 r2253 38 38 // 39 39 // -------------------------------------------------------------------------- 40 void Socket::NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain, int Type, const char *Name, int Port, int &rSockAddrLenOut) 40 void Socket::NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain, 41 int Type, const std::string& rName, int Port, int &rSockAddrLenOut) 41 42 { 42 43 int sockAddrLen = 0; … … 48 49 { 49 50 // Lookup hostname 50 struct hostent *phost = ::gethostbyname( Name);51 struct hostent *phost = ::gethostbyname(rName.c_str()); 51 52 if(phost != NULL) 52 53 { … … 82 83 { 83 84 // Check length of name is OK 84 unsigned int nameLen = ::strlen(Name);85 unsigned int nameLen = rName.length(); 85 86 if(nameLen >= (sizeof(addr.sa_unix.sun_path) - 1)) 86 87 { … … 92 93 #endif 93 94 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()); 95 96 } 96 97 break;
Note: See TracChangeset
for help on using the changeset viewer.
