diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 543b50f05..2d77e6da7 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -61,7 +61,7 @@ static const uint32_t INDEX_AUTHEN_ADMIN = 0x00000040; // admin key #define GXS_MASK "GXS_MASK_HACK" -//#define GEN_EXCH_DEBUG 1 +#define GEN_EXCH_DEBUG 1 static const uint32_t MSG_CLEANUP_PERIOD = 60*59; // 59 minutes static const uint32_t INTEGRITY_CHECK_PERIOD = 60*31; // 31 minutes diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index eabf21e7e..968ab0b6f 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -167,7 +167,12 @@ public: class RsGxsNetTunnelTurtleSearchGroupDataItem: public RsGxsNetTunnelItem { public: - explicit RsGxsNetTunnelTurtleSearchGroupDataItem(): RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_DATA) {} + explicit RsGxsNetTunnelTurtleSearchGroupDataItem() + : RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_DATA), + encrypted_group_data(NULL), + encrypted_group_data_len(0) + {} + virtual ~RsGxsNetTunnelTurtleSearchGroupDataItem() {} uint16_t service ; diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index bdb1f9981..ab5990bae 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -237,11 +237,10 @@ RsGenExchange::ServiceCreate_Return p3GxsChannels::service_CreateGroup(RsGxsGrpI void p3GxsChannels::notifyChanges(std::vector &changes) { -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::notifyChanges() : " << changes.size() << "changes to notify" << std::endl; +#ifdef GXSCHANNEL_DEBUG + RsDbg() << " Processing " << changes.size() << " channel changes..." << std::endl; #endif - - /* iterate through and grab any new messages */ + /* iterate through and grab any new messages */ std::set unprocessedGroups; std::vector::iterator it; @@ -295,6 +294,10 @@ void p3GxsChannels::notifyChanges(std::vector &changes) if (grpChange && rsEvents) { +#ifdef GXSCHANNEL_DEBUG + RsDbg() << " Grp Change Event or type " << grpChange->getType() << ":" << std::endl; +#endif + switch (grpChange->getType()) { case RsGxsNotify::TYPE_PROCESSED: // happens when the group is subscribed @@ -322,18 +325,27 @@ void p3GxsChannels::notifyChanges(std::vector &changes) RS_STACK_MUTEX(mKnownChannelsMutex); - if(mKnownChannels.find(grpChange->mGroupId) == mKnownChannels.end()) +#ifdef GXSCHANNEL_DEBUG + RsDbg() << " Type = Published/New " << std::endl; +#endif + if(mKnownChannels.find(grpChange->mGroupId) == mKnownChannels.end()) { - mKnownChannels.insert(std::make_pair(grpChange->mGroupId,time(NULL))) ; +#ifdef GXSCHANNEL_DEBUG + RsDbg() << " Status: unknown. Sending notification event." << std::endl; +#endif + + mKnownChannels.insert(std::make_pair(grpChange->mGroupId,time(NULL))) ; IndicateConfigChanged(); auto ev = std::make_shared(); ev->mChannelGroupId = grpChange->mGroupId; ev->mChannelEventCode = RsChannelEventCode::NEW_CHANNEL; rsEvents->postEvent(ev); - } + } +#ifdef GXSCHANNEL_DEBUG else - std::cerr << "(II) Not notifying already known channel " << grpChange->mGroupId << std::endl; + RsDbg() << " Not notifying already known channel " << grpChange->mGroupId << std::endl; +#endif } break; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 1021a3937..9cc924a33 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -312,6 +312,12 @@ void GxsGroupFrameDialog::updateSearchResults(const TurtleRequestId& sid) auto it2 = mSearchGroupsItems.find(sid); + if(it2 == mSearchGroupsItems.end()) + { + std::cerr << "(EE) received a channel group turtle search result with ID " << sid << " but no item is known for this search" << std::endl; + return; + } + QList group_items ; for(auto it3(group_infos.begin());it3!=group_infos.end();++it3)