[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#205937: "Me too!"



On Wed, 25 Feb 2004, Jason Gunthorpe wrote:

>
> On Mon, 23 Feb 2004, Chris Chiappa wrote:
>
> > programs which generally work well.  But it's not obvious to me that someone
> > who's not familiar with *why* there's a 32k buffer in the first place should
>
> It is 32k because 32k seemed like a reasonable number (something like 10x
> the largest seen at the time).
>
> The buffer doesn't resize because having a single stanza that is larger
> than 32k didn't seem likely - and actually suggests the file is in fact
> not a properly formed status file.
>
> There is no resizing code, because quite frankly, a 32k stanza is insane.
>
> Making the buffer double in size (resize) when a stanza fills it should be
> quite simple, however you risk using up all memory if you point it at a
> big file that isn't actually a package file.

Same could be said of dpkg.  Answer: don't do that then.

> mmap isn't used because this code is sometimes used on pipes.

When is that the case?

>
> The bug has been open for 6 months mostly likely because - a 32k stanza is
> insane.

dpkg doesn't work on pipes; if I were to add such support, I'd read all the
data in the pipe to a tmp file(or to a buffer allocated to the size that
needs to be read), and then parse that.




Reply to: