manual merge before creating a conflict-free PR

This commit is contained in:
csoler 2015-10-12 14:45:11 -04:00
commit 71c8dfdc58
139 changed files with 4812 additions and 4147 deletions

View file

@ -1,36 +0,0 @@
RS_TOP_DIR = ..
##### Define any flags that are needed for this section #######
###############################################################
###############################################################
include $(RS_TOP_DIR)/scripts/config.mk
###############################################################
RSOBJ = p3service.o p3chatservice.o p3msgservice.o \
p3gamelauncher.o p3ranking.o p3disc.o \
p3photoservice.o \
p3distrib.o \
p3status.o \
p3Qblog.o \
p3forums.o \
p3channels.o \
p3portservice.o
# dummy forums interface.
# p3forums-dummy.o \
TESTOBJ = forum_test.o
TESTS = forum_test
all: librs tests
forum_test : forum_test.o
$(CC) $(CFLAGS) -o forum_test forum_test.o $(OBJ) $(LIBS)
###############################################################
include $(RS_TOP_DIR)/scripts/rules.mk
###############################################################

View file

@ -439,8 +439,6 @@ void p3BanList::getBannedIps(std::list<BanListPeer> &lst)
lst.clear() ;
for(std::map<sockaddr_storage,BanListPeer>::const_iterator it(mBanSet.begin());it!=mBanSet.end();++it)
{
bool already_banned = false ;
if(!acceptedBanSet_locked(it->second))
continue ;
@ -498,7 +496,7 @@ bool p3BanList::addIpRange(const sockaddr_storage &addr, int masked_bytes,uint32
{
RS_STACK_MUTEX(mBanMtx) ;
if(getBitRange(addr) > masked_bytes)
if(getBitRange(addr) > uint32_t(masked_bytes))
{
std::cerr << "(EE) Input to p3BanList::addIpRange is inconsistent: ip=" << sockaddr_storage_iptostring(addr) << "/" << 32-8*masked_bytes << std::endl;
return false ;
@ -955,7 +953,7 @@ bool p3BanList::addBanEntry(const RsPeerId &peerId, const struct sockaddr_storag
{
/* see if it needs an update */
if ((mit->second.reason != reason) ||
(mit->second.level != level) ||
(mit->second.level != uint32_t(level)) ||
(mit->second.mTs < time_stamp))
{
/* update */
@ -1044,7 +1042,7 @@ int p3BanList::condenseBanSources_locked()
continue;
}
int lvl = lit->second.level;
uint32_t lvl = lit->second.level;
if (it->first != ownId)
{
/* as from someone else, increment level */

View file

@ -337,7 +337,6 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelP
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();

View file

@ -199,8 +199,7 @@ bool p3GxsForums::getGroupData(const uint32_t &token, std::vector<RsGxsForumGrou
if (item)
{
RsGxsForumGroup grp = item->mGroup;
item->mGroup.mMeta = item->meta;
grp.mMeta = item->mGroup.mMeta;
grp.mMeta = item->meta;
delete item;
groups.push_back(grp);
}
@ -230,7 +229,6 @@ bool p3GxsForums::getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();

View file

@ -187,19 +187,26 @@ void p3MsgService::processMsg(RsMsgItem *mi, bool incoming)
msi->srcId = mi->PeerId();
mSrcIds.insert(std::pair<uint32_t, RsMsgSrcId*>(msi->msgId, msi));
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
/**** STACK UNLOCKED ***/
}
// If the peer is allowed to push files, then auto-download the recommended files.
if(rsPeers->servicePermissionFlags(mi->PeerId()) & RS_NODE_PERM_ALLOW_PUSH)
for(std::list<RsTlvFileItem>::const_iterator it(mi->attachment.items.begin());it!=mi->attachment.items.end();++it)
rsFiles->FileRequest((*it).name,(*it).hash,(*it).filesize,std::string(),RS_FILE_REQ_ANONYMOUS_ROUTING,std::list<RsPeerId>()) ;
if (incoming)
{
// If the peer is allowed to push files, then auto-download the recommended files.
if(rsPeers->servicePermissionFlags(mi->PeerId()) & RS_NODE_PERM_ALLOW_PUSH)
{
std::list<RsPeerId> srcIds;
srcIds.push_back(mi->PeerId());
for(std::list<RsTlvFileItem>::const_iterator it(mi->attachment.items.begin());it!=mi->attachment.items.end();++it)
rsFiles->FileRequest((*it).name,(*it).hash,(*it).filesize,std::string(),RS_FILE_REQ_ANONYMOUS_ROUTING,srcIds) ;
}
}
RsServer::notify()->notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_ADD);
/**** STACK UNLOCKED ***/
}
bool p3MsgService::checkAndRebuildPartialMessage(RsMsgItem *ci)
{
// Check is the item is ending an incomplete item.