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(peer_list): clear the m_candidate_cache when clear peer_list, and… #7460

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

Lwxiang
Copy link
Contributor

@Lwxiang Lwxiang commented Jun 27, 2023

… set m_num_seeds to 0

@Lwxiang
Copy link
Contributor Author

Lwxiang commented Jun 27, 2023

when user call torrent_handle::clear_peers(), it will trigger the peer_list::clear().

then the m_candidate_cache which contains the pointers of peers should also be cleaned after the pointers being freed. I believe this issue causes some crash in #7386 or #7398.

also the m_num_seeds should be reset to 0.

@Lwxiang
Copy link
Contributor Author

Lwxiang commented Jun 28, 2023

it seems the failing checks is about ssl, @arvidn PTAL

@arvidn
Copy link
Owner

arvidn commented Jun 28, 2023

great catch!
yes, I will have to update the test certificates.

Would you mind extending the unit test to cover this fix as well?

@Lwxiang
Copy link
Contributor Author

Lwxiang commented Jun 28, 2023

sure, I will add some test later.

@Lwxiang
Copy link
Contributor Author

Lwxiang commented Jun 28, 2023

already add the clear_peers unit test for peer_list.

before fix, it will not pass the test:
企业微信截图_549922df-747b-4b77-be20-55bf821b7133

after fix, it pass the test:
企业微信截图_b35c76e9-2e4c-450e-a8f6-c36d0cbc197f

@Lwxiang
Copy link
Contributor Author

Lwxiang commented Jun 29, 2023

@arvidn hi PTAL, can this be merged?

@arvidn arvidn closed this Jul 3, 2023
@arvidn arvidn reopened this Jul 3, 2023
@arvidn arvidn closed this Jul 4, 2023
@arvidn arvidn reopened this Jul 4, 2023
@Lwxiang
Copy link
Contributor Author

Lwxiang commented Jul 6, 2023

@arvidn seems there are some mistakes with test_resume, the testcase compares the microsecond-duration with second-duration.

@arvidn arvidn merged commit 4257b65 into arvidn:RC_1_2 Aug 24, 2023
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.

None yet

2 participants