mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 05:22:31 -04:00
Added thread safe function for inet_ntoa in libbitdht.
Used the existing thread safe function for inet_ntoa in libretroshare. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5033 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
117d10eb44
commit
0b1126babf
10 changed files with 24 additions and 9 deletions
|
@ -126,7 +126,7 @@ int bdFilter::addPeerToFilter(const bdId *id, uint32_t flags)
|
|||
uint32_t saddr = id->addr.sin_addr.s_addr;
|
||||
mIpsBanned.insert(saddr);
|
||||
|
||||
std::cerr << "Adding New Banned Ip Address: " << inet_ntoa(id->addr.sin_addr);
|
||||
std::cerr << "Adding New Banned Ip Address: " << bdnet_inet_ntoa(id->addr.sin_addr);
|
||||
std::cerr << std::endl;
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1031,7 +1031,7 @@ int bdNodeManager::getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &fro
|
|||
from = pit->second.mDhtAddr;
|
||||
|
||||
std::cerr << "bdNodeManager::getDhtPeerAddress() Found Peer Address:";
|
||||
std::cerr << inet_ntoa(from.sin_addr) << ":" << htons(from.sin_port);
|
||||
std::cerr << bdnet_inet_ntoa(from.sin_addr) << ":" << htons(from.sin_port);
|
||||
std::cerr << std::endl;
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -2234,7 +2234,7 @@ bdNodeNetMsg::bdNodeNetMsg(char *msg, int len, struct sockaddr_in *in_addr)
|
|||
void bdNodeNetMsg::print(std::ostream &out)
|
||||
{
|
||||
out << "bdNodeNetMsg::print(" << mSize << ") to "
|
||||
<< inet_ntoa(addr.sin_addr) << ":" << htons(addr.sin_port);
|
||||
<< bdnet_inet_ntoa(addr.sin_addr) << ":" << htons(addr.sin_port);
|
||||
out << std::endl;
|
||||
}
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ void bdStdPrintNodeId(std::ostream &out, const bdNodeId *a)
|
|||
void bdStdPrintId(std::ostream &out, const bdId *a)
|
||||
{
|
||||
bdStdPrintNodeId(out, &(a->id));
|
||||
out << " ip:" << inet_ntoa(a->addr.sin_addr);
|
||||
out << " ip:" << bdnet_inet_ntoa(a->addr.sin_addr);
|
||||
out << ":" << ntohs(a->addr.sin_port);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -227,7 +227,7 @@ void bdStore::writeStore(std::string file)
|
|||
std::list<bdPeer>::iterator it;
|
||||
for(it = store.begin(); it != store.end(); it++)
|
||||
{
|
||||
fprintf(fd, "%s %d\n", inet_ntoa(it->mPeerId.addr.sin_addr), ntohs(it->mPeerId.addr.sin_port));
|
||||
fprintf(fd, "%s %d\n", bdnet_inet_ntoa(it->mPeerId.addr.sin_addr).c_str(), ntohs(it->mPeerId.addr.sin_port));
|
||||
#ifdef DEBUG_STORE
|
||||
fprintf(stderr, "Storing Peer Address: %s %d\n", inet_ntoa(it->mPeerId.addr.sin_addr), ntohs(it->mPeerId.addr.sin_port));
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue