aboutsummaryrefslogtreecommitdiff
path: root/src/proxy_protocol.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2018-12-04 15:23:28 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2018-12-04 15:23:28 +0100
commite85fa96cf7744aefca828fdb99812b31ddb2d762 (patch)
tree78fafb440ece2ef513d5d2802c5ba9fda984fcb8 /src/proxy_protocol.erl
parentUpdate deps (diff)
Proxy protocol may send additional data after addresses
Diffstat (limited to '')
-rw-r--r--src/proxy_protocol.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/proxy_protocol.erl b/src/proxy_protocol.erl
index 232f9cca3..2103a4004 100644
--- a/src/proxy_protocol.erl
+++ b/src/proxy_protocol.erl
@@ -109,7 +109,8 @@ decode_v2(SockMod, Socket, Timeout) ->
<<D1:8, D2:8, D3:8, D4:8,
S1:8, S2:8, S3:8, S4:8,
DP:16/big-unsigned-integer,
- SP:16/big-unsigned-integer>> ->
+ SP:16/big-unsigned-integer,
+ _/binary>> ->
{{{S1, S2, S3, S4}, SP},
{{D1, D2, D3, D4}, DP}};
_ ->
@@ -135,7 +136,8 @@ decode_v2(SockMod, Socket, Timeout) ->
S7:16/big-unsigned-integer,
S8:16/big-unsigned-integer,
DP:16/big-unsigned-integer,
- SP:16/big-unsigned-integer>> ->
+ SP:16/big-unsigned-integer,
+ _/binary>> ->
{{{S1, S2, S3, S4, S5, S6, S7, S8}, SP},
{{D1, D2, D3, D4, D5, D6, D7, D8}, DP}};
_ ->