Fix tor identity logic in Request.send
This commit is contained in:
parent
ea88f4bd1d
commit
0f92d92604
|
@ -195,7 +195,8 @@ class Request:
|
||||||
'User-Agent': self.modified_user_agent
|
'User-Agent': self.modified_user_agent
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.tor and not send_tor_signal(Signal.NEWNYM): # Request new identity if the last one failed
|
# Validate Tor connection and request new identity if the last one failed
|
||||||
|
if self.tor and not send_tor_signal(Signal.NEWNYM if attempt > 0 else Signal.HEARTBEAT):
|
||||||
raise TorError("Tor was previously enabled, but the connection has been dropped. Please check your " +
|
raise TorError("Tor was previously enabled, but the connection has been dropped. Please check your " +
|
||||||
"Tor configuration and try again.", disable=True)
|
"Tor configuration and try again.", disable=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user