On Fri, Apr 18, 2014 at 12:42:26PM +0200, Pieter Hintjens wrote:
> On Fri, Apr 18, 2014 at 12:29 PM, Goswin von Brederlow
> <[email protected]> wrote:
> 
> > I guess you would need something to recv() into a pre-allocated
> > buffer. That would need some patches.
> 
> It would be nice. I assume over-sized messages would be truncated
> then. That is actually good, it reduces the risk of DoS attacks ("send
> 5GB message to this node").

I was thinking more of a malloc_hook so truncation wouldn't happen.
You don't want to have fixed sized buffers because then short messages
would still waste a full sized buffer and large messages would need to
truncate.

In case of a 5GB DoS message the malloc_hook could then simply return
NULL to signify an allocation failure.

MfG
        Goswin
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to