mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-23 22:01:05 -05:00
fixed a few bugs
This commit is contained in:
parent
bdbcadc43c
commit
f352235ccd
@ -38,7 +38,7 @@
|
||||
using namespace Tor;
|
||||
|
||||
AddOnionCommand::AddOnionCommand(HiddenService *service)
|
||||
: m_service(service)
|
||||
: m_service(service), mSucceeded([](){}), mFailed([](int){})
|
||||
{
|
||||
assert(m_service);
|
||||
}
|
||||
|
@ -487,7 +487,7 @@ void TorControl::getTorInfo()
|
||||
void TorControl::getTorInfoReply(TorControlCommand *sender)
|
||||
{
|
||||
GetConfCommand *command = dynamic_cast<GetConfCommand*>(sender);
|
||||
if (!command || !isConnected())
|
||||
if (!command)// || !isConnected())
|
||||
return;
|
||||
|
||||
std::list<ByteArray> listenAddresses = splitQuotedStrings(command->get("net/listeners/socks").front(), ' ');
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
void setAuthPassword(const ByteArray& password);
|
||||
|
||||
/* Connection */
|
||||
bool isConnected() const { return status() == Authenticated; }
|
||||
bool isConnected() const { return status() >= Authenticated; }
|
||||
void connect(const std::string &address, uint16_t port);
|
||||
void authenticate();
|
||||
|
||||
|
@ -53,21 +53,13 @@ TorControlDialog::TorControlDialog(QWidget *)
|
||||
|
||||
void TorControlDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
|
||||
{
|
||||
if(event->mType != RsEventType::TOR_MANAGER) return;
|
||||
if(event->mType != RsEventType::TOR_MANAGER) return;
|
||||
|
||||
const RsTorManagerEvent *fe = dynamic_cast<const RsTorManagerEvent*>(event.get());
|
||||
if(!fe)
|
||||
return;
|
||||
const RsTorManagerEvent *fe = dynamic_cast<const RsTorManagerEvent*>(event.get());
|
||||
if(!fe)
|
||||
return;
|
||||
|
||||
switch (fe->mTorManagerEventType)
|
||||
{
|
||||
case RsTorManagerEventCode::BOOTSTRAP_STATUS_CHANGED:
|
||||
case RsTorManagerEventCode::TOR_CONNECTIVITY_CHANGED:
|
||||
case RsTorManagerEventCode::TOR_STATUS_CHANGED: statusChanged(fe->mTorStatus,fe->mTorConnectivityStatus);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
statusChanged(fe->mTorStatus,fe->mTorConnectivityStatus);
|
||||
}
|
||||
|
||||
void TorControlDialog::onIncomingConnection()
|
||||
@ -112,7 +104,6 @@ void TorControlDialog::statusChanged(RsTorStatus torstatus, RsTorConnectivitySta
|
||||
|
||||
std::cerr << "Tor control status: " << tor_control_status_str.toStdString() << std::endl;
|
||||
std::cerr << "Tor status: " << torstatus_str.toStdString() << std::endl;
|
||||
|
||||
std::cerr << "Bootstrap status map: " << std::endl;
|
||||
|
||||
for(auto it(qvm.begin());it!=qvm.end();++it)
|
||||
|
@ -100,12 +100,12 @@ void TorStatus::getTorStatus()
|
||||
switch(tor_control_status)
|
||||
{
|
||||
default:
|
||||
case RsTorConnectivityStatus::ERROR : tor_control_ok = false ; tor_control_status_str = "Error" ; break ;
|
||||
case RsTorConnectivityStatus::NOT_CONNECTED: tor_control_ok = false ; tor_control_status_str = "Not connected" ; break ;
|
||||
case RsTorConnectivityStatus::CONNECTING: tor_control_ok = false ; tor_control_status_str = "Connecting" ; break ;
|
||||
case RsTorConnectivityStatus::AUTHENTICATING: tor_control_ok = false ; tor_control_status_str = "Authenticating" ; break ;
|
||||
case RsTorConnectivityStatus::AUTHENTICATED: tor_control_ok = false ; tor_control_status_str = "Connected" ; break ;
|
||||
case RsTorConnectivityStatus::HIDDEN_SERVICE_READY: tor_control_ok = true ; tor_control_status_str = "Hidden service ready" ; break ;
|
||||
case RsTorConnectivityStatus::ERROR : tor_control_ok = false ; tor_control_status_str = "Error" ; break ;
|
||||
case RsTorConnectivityStatus::NOT_CONNECTED: tor_control_ok = false ; tor_control_status_str = "Not connected" ; break ;
|
||||
case RsTorConnectivityStatus::CONNECTING: tor_control_ok = false ; tor_control_status_str = "Connecting" ; break ;
|
||||
case RsTorConnectivityStatus::AUTHENTICATING: tor_control_ok = false ; tor_control_status_str = "Authenticating" ; break ;
|
||||
case RsTorConnectivityStatus::AUTHENTICATED: tor_control_ok = false ; tor_control_status_str = "Connected" ; break ;
|
||||
case RsTorConnectivityStatus::HIDDEN_SERVICE_READY: tor_control_ok = true ; tor_control_status_str = "Hidden service ready" ; break ;
|
||||
}
|
||||
|
||||
switch(torstatus)
|
||||
@ -141,12 +141,12 @@ void TorStatus::getTorStatus()
|
||||
if(!_updated)
|
||||
{
|
||||
RsPeerDetails pd;
|
||||
uint32_t hiddentype;
|
||||
if (rsPeers->getPeerDetails(rsPeers->getOwnId(), pd)) {
|
||||
uint32_t hiddentype = RS_HIDDEN_TYPE_UNKNOWN;
|
||||
|
||||
if (rsPeers->getPeerDetails(rsPeers->getOwnId(), pd))
|
||||
{
|
||||
if(pd.netMode == RS_NETMODE_HIDDEN)
|
||||
{
|
||||
hiddentype = pd.hiddenType;
|
||||
}
|
||||
}
|
||||
std::string proxyaddr;
|
||||
uint16_t proxyport;
|
||||
|
Loading…
Reference in New Issue
Block a user