httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: [PATCH] DoS fix
Date Sat, 08 Aug 1998 21:15:13 GMT
Dean Gaudet wrote:
> 
> This replaces the O(n^2) space with O(n), and the O(n^2) cpu time stuff
> with O(n*lg(n)).  The idea is simple -- read everything first, without
> merging, then sort based on the keys, then merge the values if required.
> 
> Lightly tested.  (i.e. I tested a few boundary conditions and basic
> functionality).
> 
> Roy:  I haven't looked at the standard yet, but does it mandate that
> footers must be merged with headers?  It should mention it if it doesn't
> already.
> 
> Martin:  I imagine the proxy is subject to a similar attack, I'm just
> guessing though.  This get_mime_headers thing should be generalized if so.
> 
> It sucks that we have to put all this crap into the normal path.  Oh well.
> At least with the flow front end we can ignore stupid requests and punt
> them to this full, slow handler.
> 
> Dean
> 
> Index: main/http_protocol.c
> ===================================================================
> RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
> retrieving revision 1.229
> diff -u -r1.229 http_protocol.c
> --- http_protocol.c     1998/08/06 17:30:30     1.229
> +++ http_protocol.c     1998/08/08 05:56:08
> @@ -708,12 +708,76 @@
>      return 1;
>  }
> 
> +/* Curse libc and the fact that it doesn't guarantee a stable sort.  We
> + * have to enforce stability ourselves by using the order field. -djg
> + */

Err? a) You are allowed to return 0 when they are equal and b) if you
really care, compare a->val to b->val (the address, not the content).

Or are you saying that if you return 0 a lot it may become O(n^2) (in
which case use b)?

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author     http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache/

WE'RE RECRUITING! http://www.aldigital.co.uk/recruit/

Mime
View raw message