diff options
author | Loïc Hoguin <[email protected]> | 2012-08-27 11:50:35 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2012-08-27 11:50:35 +0200 |
commit | e4124de2c71564d37b3732ede0fe1542de1d6f99 (patch) | |
tree | 0e632d9eb44c848bfc4b9190251e7c8566c8debc /src/cowboy_http_static.erl | |
parent | 50e5a616dcaa765f0c795f565d361196823ed2fe (diff) | |
download | cowboy-e4124de2c71564d37b3732ede0fe1542de1d6f99.tar.gz cowboy-e4124de2c71564d37b3732ede0fe1542de1d6f99.tar.bz2 cowboy-e4124de2c71564d37b3732ede0fe1542de1d6f99.zip |
Switch to Ranch for connection handling
This is the first of many API incompatible changes.
You have been warned.
Diffstat (limited to 'src/cowboy_http_static.erl')
-rw-r--r-- | src/cowboy_http_static.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cowboy_http_static.erl b/src/cowboy_http_static.erl index 65e2595..1eb375b 100644 --- a/src/cowboy_http_static.erl +++ b/src/cowboy_http_static.erl @@ -326,13 +326,14 @@ file_contents(Req, #state{filepath=Filepath, -spec content_function(module(), inet:socket(), binary()) -> fun(() -> {sent, non_neg_integer()}). content_function(Transport, Socket, Filepath) -> - %% `file:sendfile/2' will only work with the `cowboy_tcp_transport' + %% `file:sendfile/2' will only work with the `ranch_tcp' %% transport module. SSL or future SPDY transports that require the - %% content to be encrypted or framed as the content is sent. + %% content to be encrypted or framed as the content is sent + %% will use the fallback mechanism. case erlang:function_exported(file, sendfile, 2) of false -> fun() -> sfallback(Transport, Socket, Filepath) end; - _ when Transport =/= cowboy_tcp_transport -> + _ when Transport =/= ranch_tcp -> fun() -> sfallback(Transport, Socket, Filepath) end; true -> fun() -> sendfile(Socket, Filepath) end |