aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-01-15 17:38:24 +0100
committerLoïc Hoguin <[email protected]>2013-01-15 17:38:24 +0100
commit56d75d4c03bd6eb0f7c89806b310a9c38022b6fd (patch)
tree357f7d1a135a7bdbb1b355191897cebc040a5b82 /src
parent9fd9294a13375a56c42b4b77225bbe317ecf0b4d (diff)
parentc7bf6d2e4d4ae559ffd1ca429cbe605f710e7f0c (diff)
downloadranch-56d75d4c03bd6eb0f7c89806b310a9c38022b6fd.tar.gz
ranch-56d75d4c03bd6eb0f7c89806b310a9c38022b6fd.tar.bz2
ranch-56d75d4c03bd6eb0f7c89806b310a9c38022b6fd.zip
Merge branch 'master' of https://github.com/ferd/ranch
Diffstat (limited to 'src')
-rw-r--r--src/ranch.erl5
-rw-r--r--src/ranch_ssl.erl2
-rw-r--r--src/ranch_tcp.erl2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/ranch.erl b/src/ranch.erl
index 752819e..6f1b6fe 100644
--- a/src/ranch.erl
+++ b/src/ranch.erl
@@ -169,6 +169,11 @@ filter_options([Opt = {Key, _}|Tail], AllowedKeys, Acc) ->
case lists:member(Key, AllowedKeys) of
true -> filter_options(Tail, AllowedKeys, [Opt|Acc]);
false -> filter_options(Tail, AllowedKeys, Acc)
+ end;
+filter_options([Opt = {raw, _, _, _}|Tail], AllowedKeys, Acc) ->
+ case lists:member(raw, AllowedKeys) of
+ true -> filter_options(Tail, AllowedKeys, [Opt|Acc]);
+ false -> filter_options(Tail, AllowedKeys, Acc)
end.
%% @doc Add an option to a list, but only if it wasn't previously set.
diff --git a/src/ranch_ssl.erl b/src/ranch_ssl.erl
index 734de21..d880cc8 100644
--- a/src/ranch_ssl.erl
+++ b/src/ranch_ssl.erl
@@ -95,7 +95,7 @@ listen(Opts) ->
%% first argument.
ssl:listen(0, ranch:filter_options(Opts2,
[backlog, cacertfile, certfile, ciphers, ip,
- keyfile, nodelay, password, port, verify],
+ keyfile, nodelay, password, port, raw, verify],
[binary, {active, false}, {packet, raw},
{reuseaddr, true}, {nodelay, true}])).
diff --git a/src/ranch_tcp.erl b/src/ranch_tcp.erl
index b113186..bb7ad55 100644
--- a/src/ranch_tcp.erl
+++ b/src/ranch_tcp.erl
@@ -70,7 +70,7 @@ listen(Opts) ->
%% We set the port to 0 because it is given in the Opts directly.
%% The port in the options takes precedence over the one in the
%% first argument.
- gen_tcp:listen(0, ranch:filter_options(Opts2, [backlog, ip, nodelay, port],
+ gen_tcp:listen(0, ranch:filter_options(Opts2, [backlog, ip, nodelay, port, raw],
[binary, {active, false}, {packet, raw},
{reuseaddr, true}, {nodelay, true}])).