Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a crash with protected Tor control port #785

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

CyberTailor
Copy link
Contributor

No description provided.

@CyberTailor
Copy link
Contributor Author

CyberTailor commented Jun 14, 2022

Reference: #746

@CyberTailor CyberTailor changed the base branch from develop to main June 15, 2022 00:07
@MadcowOG
Copy link
Contributor

This doesn't work, send_tor_signal is used for more than just to check for Tor availability. I made this same mistake in my pull request, too. We do need to authenticate with the Tor control port because of a new identity request.

This condition can be found at around line 300 in request.py:

# Validate Tor conn 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 Tor configuration and try again.",
                disable=True)

We use this to ask Tor for a new circuit in the case google starts rejecting our requests or hit us with a captcha.

@CyberTailor
Copy link
Contributor Author

Oops, missed it. Now AuthentificationError sets TOR_AVAILABLE to 0.

@benbusby benbusby merged commit 194b2ea into benbusby:main Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants