[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Patch: add constraints on HTTP first line/headers/body size



Hi,

On Wed, Oct 7, 2009 at 10:16 PM, q6Yr7e0o nIJDVMjC <u9oqcd4p@xxxxxxxxxxxxxx> wrote:

I like the idea but defining SIZE_UNLIMITED as -1 and comparing a
size_t to it doesn't seem right somehow. Wouldn't it be better do
define SIZE_UNLIMITED to 0 which is a valid size_t value and does not
make sense for the limits so it can be used as magic number?

I see no reason why it can't be -1 (well, the best way here is to define SIZE_UNLIMITED as ((size_t) -1) ). Btw, setting the 'unlimited' constant to 0 is definitely wrong solution.

--
WBR,
Constantine