-
Notifications
You must be signed in to change notification settings - Fork 3k
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: httpc set_options override #8878
base: maint
Are you sure you want to change the base?
Conversation
CT Test Results 2 files 22 suites 10m 39s ⏱️ Results for commit 7f4340a. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
f3f1aad
to
762fe61
Compare
|
The bug was due to invalid validation of options that was acting like the user always passed
ipfamily
andunix_socket
options, so each time when callingset_option(s)
those options would get overridden by default values (if option values weren't present in the new options list).Validation of
ipfamily
andunix_socket
combination was not just buggy, but also insufficient because the httpc state could end up with invalid combination of those options which I proved in thehttpc_SUITE:invalid_ipfamily_unix_socket/1
testcase (which fails on the current code). I also believe that there was a typo inhttpc:validate_ipfamily_unix_socket/1
whereipfamily
option got deleted twice, butunix_socket
was not, so we could end up having twounix_socket
entries after validation....With the new behavior that checks current and new options
httpc
can't end up having invalid ipfamily-unix_socket combo. I also believe that new error is more informative to the user on what's going on and why validation failed.I also removed deprecated
ipv6
handling inhttpc_manager
becauseipv6
gets translated toipfamily
option inhttpc:validate_options/3
so there is no way thatipv6
entry can ever be passed tohttpc_manager
.httpc_manager:set_options
is called only fromhttpc:set_options
which validates (and translates)ipv6
option so this should be safe.Closes #8829