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

Disallow GetPublicKey when DisableValues is passed #604

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

aschmahmann
Copy link
Contributor

No description provided.

dht_options.go Outdated
Comment on lines 94 to 97

if !c.enableValues {
c.validator = nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stebalien do you think this is worth doing or no? We have some tests and I've done a once-over and it looks like we shouldn't have any problems with nil validators if enableValues=false, if it's enableValues=true though is it fair to say the developer has shot themselves in the foot or should we throw in a bunch of nil checks or implement a NilValidator that's applied here in the fallbacks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just leave the validator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess no particular reason, it's not like it's going to eat up much memory. This was more a point for discussing what we should do around nil validators.

I'll remove those few lines and merge.

dht_options.go Outdated
Comment on lines 94 to 97

if !c.enableValues {
c.validator = nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just leave the validator?

@aschmahmann
Copy link
Contributor Author

This is missing a test to confirm the new behavior, but is otherwise ready

@Stebalien Stebalien merged commit d76b88a into master Sep 15, 2021
@Stebalien
Copy link
Member

Let's not leave it in a PR.

@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 tasks
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.

2 participants