{packet, 4}

Roberto Ostinelli ostinelli@REDACTED
Fri Apr 17 11:55:26 CEST 2020


Forgot to add: is packet_size the option that I can use to circumvent this?

Thanks,
r.

On Fri, Apr 17, 2020 at 11:49 AM Roberto Ostinelli <ostinelli@REDACTED>
wrote:

> All,
> Hope you are safe and well.
>
> This is probably a stupid question and I probably need more coffe, but...
> if I use {packet, 4} as a transport option on a server that uses a binary
> protocol, it means that it might wait for up to 256^4 so 4,294,967,296
> bytes of data. If I'm not mistaken, then this could be an easy target for
> DDoS attacks (client are not necessarily well-known).
>
> Unfortunately this server needs to be able to receive data messages up to
> 250k of size in JSON format, so {packet, 2} is not an option.
>
> Is my only option to set {packet, raw} and run a streamed json parser, or
> is there another way to limit the amount of data in some other way?
>
> Thank you,
> r.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200417/4218dc62/attachment.htm>


More information about the erlang-questions mailing list