mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 15:35:49 -04:00
Merge pull request #1826 from csoler/v0.6-FT4
attempt to solve GXS data access problems in new blocking API
This commit is contained in:
commit
4c4b7ce754
16 changed files with 73 additions and 50 deletions
|
@ -140,7 +140,7 @@ virtual bool getChannelDownloadDirectory(const RsGxsGroupId &groupId, std::strin
|
|||
std::vector<RsGxsComment> &msgs ) override
|
||||
{ return mCommentService->getGxsRelatedComments(token, msgs); }
|
||||
|
||||
virtual bool createNewComment(uint32_t &token, RsGxsComment &msg) override
|
||||
virtual bool createNewComment(uint32_t &token, const RsGxsComment &msg) override
|
||||
{
|
||||
return mCommentService->createGxsComment(token, msg);
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
|
|||
|
||||
/// @deprecated Implementation of @see RsGxsChannels::createComment
|
||||
RS_DEPRECATED_FOR(createCommentV2)
|
||||
bool createComment(RsGxsComment& comment) override;
|
||||
bool createComment(RsGxsComment &comment) override;
|
||||
|
||||
/// @deprecated Implementation of @see RsGxsChannels::createVote
|
||||
RS_DEPRECATED_FOR(createVoteV2)
|
||||
|
|
|
@ -278,9 +278,13 @@ bool p3GxsCircles::getCirclesSummaries(std::list<RsGroupMetaData>& circles)
|
|||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
||||
if( !requestGroupInfo(token, opts)
|
||||
|| waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
return getGroupSummary(token, circles);
|
||||
if( !requestGroupInfo(token, opts) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
{
|
||||
std::cerr << "Cannot get circles summary. Token queue is overloaded?" << std::endl;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return getGroupSummary(token, circles);
|
||||
}
|
||||
|
||||
bool p3GxsCircles::getCirclesInfo( const std::list<RsGxsGroupId>& circlesIds,
|
||||
|
@ -289,9 +293,13 @@ bool p3GxsCircles::getCirclesInfo( const std::list<RsGxsGroupId>& circlesIds,
|
|||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
if( !requestGroupInfo(token, opts, circlesIds)
|
||||
|| waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
return getGroupData(token, circlesInfo);
|
||||
if( !requestGroupInfo(token, opts, circlesIds) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
{
|
||||
std::cerr << "Cannot get circle info. Token queue is overloaded?" << std::endl;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return getGroupData(token, circlesInfo);
|
||||
}
|
||||
|
||||
bool p3GxsCircles::getCircleRequests( const RsGxsGroupId& circleId,
|
||||
|
|
|
@ -425,7 +425,7 @@ double p3GxsCommentService::calculateBestScore(int upVotes, int downVotes)
|
|||
|
||||
/********************************************************************************************/
|
||||
|
||||
bool p3GxsCommentService::createGxsComment(uint32_t &token, RsGxsComment &msg)
|
||||
bool p3GxsCommentService::createGxsComment(uint32_t &token, const RsGxsComment &msg)
|
||||
{
|
||||
#ifdef DEBUG_GXSCOMMON
|
||||
std::cerr << "p3GxsCommentService::createGxsComment() GroupId: " << msg.mMeta.mGroupId;
|
||||
|
|
|
@ -66,7 +66,7 @@ class p3GxsCommentService: public GxsTokenQueue
|
|||
bool getGxsCommentData(const uint32_t &token, std::vector<RsGxsComment> &msgs);
|
||||
bool getGxsRelatedComments(const uint32_t &token, std::vector<RsGxsComment> &msgs);
|
||||
|
||||
bool createGxsComment(uint32_t &token, RsGxsComment &msg);
|
||||
bool createGxsComment(uint32_t &token, const RsGxsComment &msg);
|
||||
bool createGxsVote(uint32_t &token, RsGxsVote &msg);
|
||||
|
||||
// Special Acknowledge.
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
return mCommentService->getGxsRelatedComments(token, msgs);
|
||||
}
|
||||
|
||||
virtual bool createNewComment(uint32_t &token, RsGxsComment &msg) override
|
||||
virtual bool createNewComment(uint32_t &token, const RsGxsComment &msg) override
|
||||
{
|
||||
return mCommentService->createGxsComment(token, msg);
|
||||
}
|
||||
|
|
|
@ -96,10 +96,16 @@ virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgI
|
|||
std::vector<RsGxsComment> &msgs )
|
||||
{ return mCommentService->getGxsRelatedComments(token, msgs); }
|
||||
|
||||
virtual bool createNewComment(uint32_t &token, RsGxsComment &msg)
|
||||
virtual bool createNewComment(uint32_t &token, const RsGxsComment &msg) override
|
||||
{
|
||||
return mCommentService->createGxsComment(token, msg);
|
||||
}
|
||||
virtual bool createComment(RsGxsComment& msg) override
|
||||
{
|
||||
uint32_t token;
|
||||
|
||||
return mCommentService->createGxsComment(token, msg) && waitToken(token) == RsTokenService::COMPLETE ;
|
||||
}
|
||||
|
||||
virtual bool createNewVote(uint32_t &token, RsGxsVote &msg)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue