<div dir="ltr"><div><div><div>Hello everybody, it is my first appearance on this mailing list so feel free to remind me of all the rules I possibly break...<br><br>I noticed that in one specific case the inets:httpc request function fails to return a meaningful error and silently crashes instead. This seems to happen when the provided URL scheme is not http or https. I am just an Erlang beginner so I don't expect to be able to provide a good patch, but I have written up a mockup patch that does solve the issue, although the error message it produces is very likely not in line with the conventions used and the code itself is ugly and based only on guesswork from the surrouding code without any real understanding of what I am doing.<br><br>Anyway to reproduce the bug you might try to execute the following request on httpc: httpc:request(get, {"broken://<a href="http://erlang.org:80">erlang.org:80</a>", []}, [], [{sync,false}, {stream, self}, {receiver,fun(X)-> io:format("~p",[X])end}]).<br><br>Instead of an error I get {ok, #Ref} and in the background a httpc crash. The same happens on sync requests as well and the erl shell hangs.<br><br>The mock fix that I wrote is available here:<br><a href="https://github.com/lantti/otp/commit/8872f1ca2986757a670f386eba022481f126febc">https://github.com/lantti/otp/commit/8872f1ca2986757a670f386eba022481f126febc</a><br><br>The main points there to notice are that the function socket_type() fails with a missing clause when an unrecognized URL scheme is introduced and that we are inside the httpc:init where failing is not allowed. So I fixed that by returning an error tuple instead and pattern matching against that tuple at the calling side.<br><br></div>Maybe somebody here would like to take the time to actually write that fix properly.<br><br></div>Thank you,<br><br></div>Antti Siponen<br></div>