Skip to content

Extension uninstall mapping causes libtorrent assert failure in debug mode #37

@mnaamani

Description

@mnaamani

When we stop the extension we send an uninstall mapping where all the joystream extension message IDs are set to 0. This is leading to the TORRENT_ASSERT failure in below code.

In bt_peer_connection.cpp - write_extensions()

#ifndef NDEBUG
		// make sure there are not conflicting extensions
		std::set<int> ext;
		for (entry::dictionary_type::const_iterator i = m.begin()
			, end(m.end()); i != end; ++i)
		{
			if (i->second.type() != entry::int_t) continue;
			int val = int(i->second.integer());
			TORRENT_ASSERT(ext.find(val) == ext.end()); // Failed Assert
			ext.insert(val);
		}
#endif

We might want to consider having a method for directly writing the uninstall mapping to the peer to bypass libtorrent's checking.

This isn't a serious issue when running in Release mode but it would be nice to fix so when we are testing in Debug mode we don't get the failed assert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions