Changed some mutex around p3ConnectMgr::mOwnState. Please review.

Made getIPAddressFromString thread safe, just in case.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3374 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-08-16 07:29:51 +00:00
parent 30e4509043
commit fa9ea81ad7
2 changed files with 46 additions and 37 deletions

View file

@ -132,6 +132,9 @@ bool isExternalNet(const struct in_addr *addr)
bool getIPAddressFromString (const char *addr_str, struct in_addr *addr)
{
if (addr_str && addr) {
static RsMutex mtx;
RsStackMutex stack(mtx);
hostent *pHost = gethostbyname (addr_str);
if (pHost) {
addr->s_addr = *(unsigned long*) (pHost->h_addr);