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

External ip #11

Merged
merged 2 commits into from
Jul 6, 2021
Merged

External ip #11

merged 2 commits into from
Jul 6, 2021

Conversation

quancore
Copy link

@quancore quancore commented Jul 4, 2020

The current resolver class has a bug on get_real_ext_ip method. For getting a random resolver, it calls _pop_random_ip_host method, which removes and returns a resolver. But after several calls, _ip_hosts list become empty since all resolvers are popped out. I have added a temp list to make the original resolver list intact.

…thread other then main thread since add_signal_handler only work in the main thread
@sonarcloud
Copy link

sonarcloud bot commented Jul 4, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 1 Security Hotspot to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bluet
Copy link
Owner

bluet commented Aug 15, 2020

@afunTW are you able to help? XD

@bluet bluet added the help wanted Extra attention is needed label Apr 7, 2021
@bluet bluet unassigned afunTW Apr 7, 2021
@vincentinttsh
Copy link
Collaborator

resolver.py 中的 function get_real_ext_ip 是想透過 _ip_hosts 中的網站得到 proxy 的 ip,
採用的方式是每次隨機找一個 _ip_hosts 中的網站去問,如果時間內沒回應,就再次隨機找一個 _ip_hosts 中的網站去問,
為了怕問到同一個,然後又再次 time out,被隨機挑中的網站都會被移出 _ip_hosts,最慢第八次 call 這個 function 就會沒有網站能問,所以這個 PR 稍微改變作法,改成每次 call 這個 function 就 copy 一份 _ip_hosts 成 _temp_host,做上述一樣的事,但移除網站是移除 _temp_host 中的,這樣就不會發生 “ 最慢第八次 call 這個 function 就會沒有網站能問 ” 的狀況

@vincentinttsh
Copy link
Collaborator

api.py 提供開發者選擇 stop_broker_on_sigin (whether set SIGINT signal on broker object. Useful for a thread other than main thread.),預設是true

@vincentinttsh
Copy link
Collaborator

程式碼沒什麼問題

@bluet
Copy link
Owner

bluet commented Jul 6, 2021

@vincentinttsh thanks!

@bluet bluet merged commit 4f1dfe7 into bluet:master Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants