mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
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:
parent
30e4509043
commit
fa9ea81ad7
2 changed files with 46 additions and 37 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue