aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Majorov <[email protected]>2012-12-21 00:52:01 +0400
committerAndrew Majorov <[email protected]>2012-12-21 16:18:47 +0400
commit0b270b2e9cc05ad5fb5c42802c61ccf520860b7b (patch)
tree0b7cfc02d660dfdd1bf4dd806c8a622512c6f75e
parentacaa33a8709bf199493861ae9bfb01f1abe16a38 (diff)
downloadranch-0b270b2e9cc05ad5fb5c42802c61ccf520860b7b.tar.gz
ranch-0b270b2e9cc05ad5fb5c42802c61ccf520860b7b.tar.bz2
ranch-0b270b2e9cc05ad5fb5c42802c61ccf520860b7b.zip
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.
-rw-r--r--src/ranch.erl1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ranch.erl b/src/ranch.erl
index 0924ee7..59e1fa7 100644
--- a/src/ranch.erl
+++ b/src/ranch.erl
@@ -55,6 +55,7 @@
start_listener(Ref, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts)
when is_integer(NbAcceptors) andalso is_atom(Transport)
andalso is_atom(Protocol) ->
+ _ = code:ensure_loaded(Transport),
case erlang:function_exported(Transport, name, 0) of
false ->
{error, badarg};