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

connect socket options need to be filtered out when making subsequent calls #161

Open
someotherrandomdude opened this issue Mar 14, 2018 · 0 comments

Comments

@someotherrandomdude
Copy link

in ibrowse_http_client:send_req1
ok = do_setopts(Socket, Caller_socket_options, State), is called with the originally provided socket options,
but these need the connect options filtering out as they are invalid when set on a connected socket, causing the call to ibrowse:send_req/X fail

the below works for me, called on the Caller_socket_options before doing the setopts, not sure if you want to also re-filter using the existing filter_socket_options, which also isn't called on the Caller_socket_options when the socket is open.

Tried to make a branch and push but looks like I don't have permissions.

%%Once a socket is connected, passing certain options is no longer valid
filter_sock_connect_options(Opts) ->
lists:filter(
fun({port, _Port}) ->
false;
({ip, _SocketAddr}) ->
false;
({fd, _Fd}) ->
false;
({ifaddr, _SocketAddr}) ->
false;
({tcp_module, Module}) ->
false;
(inet) ->
false;
(inet6) ->
false;
(local) ->
false;
(
) ->
true
end, Opts).

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

No branches or pull requests

1 participant