From 24b2d8a2cffa383aa59f2b617841877bee3c4440 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 13 Jan 2022 21:06:56 +0100 Subject: [PATCH 1/3] added a msg in console when FS is ready --- retroshare-friendserver/src/retroshare-friendserver.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/retroshare-friendserver/src/retroshare-friendserver.cc b/retroshare-friendserver/src/retroshare-friendserver.cc index 0d7463b5c..d80ad71d6 100644 --- a/retroshare-friendserver/src/retroshare-friendserver.cc +++ b/retroshare-friendserver/src/retroshare-friendserver.cc @@ -98,6 +98,14 @@ int main(int argc, char* argv[]) FriendServer fs(base_directory,service_target_address,target_port); fs.start(); + RsDbg() << ""; + RsDbg() << "================== Retroshare Friend Server has properly started =====================" ; + RsDbg() << "= ="; + RsDbg() << "= Address:Port " << onion_address << ":" << service_port << ((service_port<10000)?" ":"") << " ="; + RsDbg() << "= ="; + RsDbg() << "======================================================================================" ; + RsDbg() << ""; + while(fs.isRunning()) std::this_thread::sleep_for(std::chrono::seconds(2)); From 5ab19eb56409b07f791c2640d0432759aaee9cea Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 15 Jan 2022 21:53:07 +0100 Subject: [PATCH 2/3] added testing system for distant Tor server --- libretroshare | 2 +- .../src/gui/FriendServerControl.cpp | 60 +++++++++---------- retroshare-gui/src/retroshare-gui.pro | 1 + 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/libretroshare b/libretroshare index f708e893a..a7a430008 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit f708e893a0cc7d195a53566342bd213973c70176 +Subproject commit a7a430008b76e53727598c4d13106e7ce95221d7 diff --git a/retroshare-gui/src/gui/FriendServerControl.cpp b/retroshare-gui/src/gui/FriendServerControl.cpp index 5598ff477..60f838e62 100644 --- a/retroshare-gui/src/gui/FriendServerControl.cpp +++ b/retroshare-gui/src/gui/FriendServerControl.cpp @@ -61,6 +61,7 @@ FriendServerControl::FriendServerControl(QWidget *parent) QObject::connect(friendServerOnOff_CB,SIGNAL(toggled(bool)),this,SLOT(onOnOffClick(bool))); QObject::connect(torServerFriendsToRequest_SB,SIGNAL(valueChanged(int)),this,SLOT(onFriendsToRequestChanged(int))); QObject::connect(torServerAddress_LE,SIGNAL(textChanged(const QString&)),this,SLOT(onOnionAddressEdit(const QString&))); + QObject::connect(torServerPort_SB,SIGNAL(valueChanged(int)),this,SLOT(onOnionAddressEdit(int))); QObject::connect(mConnectionCheckTimer,SIGNAL(timeout()),this,SLOT(checkServerAddress())); @@ -97,50 +98,47 @@ void FriendServerControl::onOnOffClick(bool b) } void FriendServerControl::onOnionPortEdit(int) { -#warning TODO -// // Setup timer to auto-check the friend server address -// -// mConnectionCheckTimer->setSingleShot(true); -// mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time. -// -// mConnectionCheckTimer->start(); -// -// if(mCheckingServerMovie->fileName() != QString(":/images/loader/circleball-16.gif" )) -// { -// mCheckingServerMovie->setFileName(":/images/loader/circleball-16.gif"); -// mCheckingServerMovie->start(); -// } - rsFriendServer->setServerAddress(torServerAddress_LE->text().toStdString(),torServerPort_SB->value()); - rsFriendServer->setProxyAddress(torProxyAddress_LE->text().toStdString(),torProxyPort_SB->value()); + // Setup timer to auto-check the friend server address + + mConnectionCheckTimer->stop(); + mConnectionCheckTimer->setSingleShot(true); + mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time. + + mConnectionCheckTimer->start(); + + if(mCheckingServerMovie->fileName() != QString(":/images/loader/circleball-16.gif" )) + { + mCheckingServerMovie->setFileName(":/images/loader/circleball-16.gif"); + mCheckingServerMovie->start(); + } } void FriendServerControl::onOnionAddressEdit(const QString&) { // Setup timer to auto-check the friend server address -// mConnectionCheckTimer->setSingleShot(true); -// mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time. -// -// mConnectionCheckTimer->start(); -// -// if(mCheckingServerMovie->fileName() != QString(":/images/loader/circleball-16.gif" )) -// { -// mCheckingServerMovie->setFileName(":/images/loader/circleball-16.gif"); -// mCheckingServerMovie->start(); -// } - rsFriendServer->setServerAddress(torServerAddress_LE->text().toStdString(),torServerPort_SB->value()); - rsFriendServer->setProxyAddress(torProxyAddress_LE->text().toStdString(),torProxyPort_SB->value()); + mConnectionCheckTimer->stop(); + mConnectionCheckTimer->setSingleShot(true); + mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time. + + mConnectionCheckTimer->start(); + + if(mCheckingServerMovie->fileName() != QString(":/images/loader/circleball-16.gif" )) + { + mCheckingServerMovie->setFileName(":/images/loader/circleball-16.gif"); + mCheckingServerMovie->start(); + } } void FriendServerControl::checkServerAddress() { - rsFriendServer->checkServerAddress_async(torServerAddress_LE->text().toStdString(),torServerPort_SB->value(), - [this](const std::string& address,bool test_result) + rsFriendServer->checkServerAddress_async(torServerAddress_LE->text().toStdString(),torServerPort_SB->value(),5000, + [this](const std::string& address,uint16_t port,bool test_result) { if(test_result) - rsFriendServer->setServerAddress(address,1729); + rsFriendServer->setServerAddress(address,port); - RsQThreadUtils::postToObject( [=]() { updateFriendServerStatusIcon(test_result); },this); + RsQThreadUtils::postToObject( [=]() { updateFriendServerStatusIcon(test_result); },this); } ); } diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 53c4835dd..3340e0f0c 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -1088,6 +1088,7 @@ DEFINES *= CHANNELS_FRAME_CATCHER # Embedded Friend Server rs_efs { + DEFINES *= RS_EMBEDED_FRIEND_SERVER SOURCES += gui/FriendServerControl.cpp HEADERS += gui/FriendServerControl.h FORMS += gui/FriendServerControl.ui From 4a5458750035a037a3afa6602c70de21832aa239 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 15 Jan 2022 22:03:27 +0100 Subject: [PATCH 3/3] fixed testing of onion server --- retroshare-gui/src/gui/FriendServerControl.cpp | 3 +-- retroshare-gui/src/gui/FriendServerControl.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/FriendServerControl.cpp b/retroshare-gui/src/gui/FriendServerControl.cpp index 60f838e62..c946521e6 100644 --- a/retroshare-gui/src/gui/FriendServerControl.cpp +++ b/retroshare-gui/src/gui/FriendServerControl.cpp @@ -61,7 +61,7 @@ FriendServerControl::FriendServerControl(QWidget *parent) QObject::connect(friendServerOnOff_CB,SIGNAL(toggled(bool)),this,SLOT(onOnOffClick(bool))); QObject::connect(torServerFriendsToRequest_SB,SIGNAL(valueChanged(int)),this,SLOT(onFriendsToRequestChanged(int))); QObject::connect(torServerAddress_LE,SIGNAL(textChanged(const QString&)),this,SLOT(onOnionAddressEdit(const QString&))); - QObject::connect(torServerPort_SB,SIGNAL(valueChanged(int)),this,SLOT(onOnionAddressEdit(int))); + QObject::connect(torServerPort_SB,SIGNAL(valueChanged(int)),this,SLOT(onOnionPortEdit(int))); QObject::connect(mConnectionCheckTimer,SIGNAL(timeout()),this,SLOT(checkServerAddress())); @@ -116,7 +116,6 @@ void FriendServerControl::onOnionPortEdit(int) void FriendServerControl::onOnionAddressEdit(const QString&) { // Setup timer to auto-check the friend server address - mConnectionCheckTimer->stop(); mConnectionCheckTimer->setSingleShot(true); mConnectionCheckTimer->setInterval(5000); // check in 5 secs unless something is changed in the mean time. diff --git a/retroshare-gui/src/gui/FriendServerControl.h b/retroshare-gui/src/gui/FriendServerControl.h index f02c8dadc..7217bcd5d 100644 --- a/retroshare-gui/src/gui/FriendServerControl.h +++ b/retroshare-gui/src/gui/FriendServerControl.h @@ -38,9 +38,9 @@ protected slots: void onOnionPortEdit(int); void onNbFriendsToRequestsChanged(int n); void updateTorProxyInfo(); + void checkServerAddress(); private: - void checkServerAddress(); void updateFriendServerStatusIcon(bool ok); QTimer *mConnectionCheckTimer;