Browse Source

Ensure transport module is loaded before checking exports

Tests were constantly failing without this patch. It seems ct
starts erlang code server in interactive mode, so application
module loading is defered.
Andrew Majorov 12 years ago
parent
commit
0b270b2e9c
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/ranch.erl

+ 1 - 0
src/ranch.erl

@@ -55,6 +55,7 @@
 start_listener(Ref, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts)
 start_listener(Ref, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts)
 		when is_integer(NbAcceptors) andalso is_atom(Transport)
 		when is_integer(NbAcceptors) andalso is_atom(Transport)
 		andalso is_atom(Protocol) ->
 		andalso is_atom(Protocol) ->
+	_ = code:ensure_loaded(Transport),
 	case erlang:function_exported(Transport, name, 0) of
 	case erlang:function_exported(Transport, name, 0) of
 		false ->
 		false ->
 			{error, badarg};
 			{error, badarg};