-
Notifications
You must be signed in to change notification settings - Fork 67
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 socket_options instead using keywork merge, concat default options with assigned options #183
Fix socket_options instead using keywork merge, concat default options with assigned options #183
Conversation
with assigned options
lib/myxql/client.ex
Outdated
@@ -43,8 +47,7 @@ defmodule MyXQL.Client do | |||
ssl_opts: Keyword.get(opts, :ssl_opts, []), | |||
connect_timeout: Keyword.get(opts, :connect_timeout, @default_timeout), | |||
handshake_timeout: Keyword.get(opts, :handshake_timeout, @default_timeout), | |||
socket_options: | |||
Keyword.merge([mode: :binary, packet: :raw, active: false], opts[:socket_options] || []), | |||
socket_options: @sock_opts ++ (opts[:socket_options] || []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want the opposite order because what comes first wins. Maybe we can also write a test? You can set socket_options: [:inet]
for the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I will do that.
Thank you! |
No description provided.