mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-11 22:10:07 -05:00
Jenkins build hotfix
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <libtorrent/entry.hpp>
|
||||
#include <libtorrent/bencode.hpp>
|
||||
//#include <libtorrent/bencode.hpp>
|
||||
#include <libtorrent/session.hpp>
|
||||
#include <libtorrent/alert_types.hpp>
|
||||
#include <libtorrent/torrent_info.hpp>
|
||||
@@ -161,23 +161,28 @@ SyncWidget::SyncWidget(QWidget* parent, Qt::WindowFlags f)
|
||||
}
|
||||
_session->start_upnp();
|
||||
|
||||
std::ifstream file(_configurationFile);
|
||||
if (!file.fail()) {
|
||||
union {
|
||||
uint32_t value;
|
||||
std::array<char, 4> data;
|
||||
} size;
|
||||
|
||||
file.read(size.data.data(), sizeof(uint32_t));
|
||||
std::vector<char> buffer(size.value);
|
||||
file.read(buffer.data(), size.value);
|
||||
file.close();
|
||||
// I commented this out as it caused the Linux build nodes to fail during linking
|
||||
// and I couldn't figure out how to fix it
|
||||
// it would throw an cxx11 ABI incompatibility error
|
||||
|
||||
libtorrent::entry e = libtorrent::bdecode(buffer.begin(), buffer.end());
|
||||
_session->start_dht(e);
|
||||
}
|
||||
else
|
||||
_session->start_dht();
|
||||
//std::ifstream file(_configurationFile);
|
||||
//if (!file.fail()) {
|
||||
// union {
|
||||
// uint32_t value;
|
||||
// std::array<char, 4> data;
|
||||
// } size;
|
||||
|
||||
// file.read(size.data.data(), sizeof(uint32_t));
|
||||
// std::vector<char> buffer(size.value);
|
||||
// file.read(buffer.data(), size.value);
|
||||
// file.close();
|
||||
|
||||
// libtorrent::entry e = libtorrent::bdecode(buffer.begin(), buffer.end());
|
||||
// _session->start_dht(e);
|
||||
//}
|
||||
//else
|
||||
_session->start_dht();
|
||||
|
||||
_session->add_dht_router({ "router.utorrent.com", 6881 });
|
||||
_session->add_dht_router({ "dht.transmissionbt.com", 6881 });
|
||||
@@ -198,18 +203,22 @@ SyncWidget::SyncWidget(QWidget* parent, Qt::WindowFlags f)
|
||||
SyncWidget::~SyncWidget() {
|
||||
libtorrent::entry dht = _session->dht_state();
|
||||
|
||||
std::vector<char> buffer;
|
||||
libtorrent::bencode(std::back_inserter(buffer), dht);
|
||||
// I commented this out as it caused the Linux build nodes to fail during linking
|
||||
// and I couldn't figure out how to fix it
|
||||
// it would throw an cxx11 ABI incompatibility error
|
||||
|
||||
std::ofstream f(_configurationFile);
|
||||
//std::vector<char> buffer;
|
||||
//libtorrent::bencode(std::back_inserter(buffer), dht);
|
||||
|
||||
union {
|
||||
uint32_t value;
|
||||
std::array<char, 4> data;
|
||||
} size;
|
||||
size.value = buffer.size();
|
||||
f.write(size.data.data(), sizeof(uint32_t));
|
||||
f.write(buffer.data(), buffer.size());
|
||||
//std::ofstream f(_configurationFile);
|
||||
|
||||
//union {
|
||||
// uint32_t value;
|
||||
// std::array<char, 4> data;
|
||||
//} size;
|
||||
//size.value = buffer.size();
|
||||
//f.write(size.data.data(), sizeof(uint32_t));
|
||||
//f.write(buffer.data(), buffer.size());
|
||||
|
||||
_downloadManager.reset();
|
||||
ghoul::deinitialize();
|
||||
|
||||
Reference in New Issue
Block a user