Best way to inspect and modify document content.

From: Alexandre Rafalovitch <alex@dont-contact.us>
Date: Tue, 13 Jun 2000 15:54:01 +1000

Good Day,

We are trying to extend squid, so it prepends a particular text to every
html document except the ones with frameset in it.

Current code sits in clientSendMoreData, looks at the first chunk and,
if the conditions are satisfied, modifies content-length header and the
content itself.

The problem,

The document content arrives in chunks and sometimes the first chunk is
too small (headers + part of <head> element, if that) and we can't
figure out whether we have frameset or normal body.

The solutions I see:
1) Keep from sending output to the client, until there is {n} K in
buffer. Preferably, so this {n} value could be controlled by the squid.
That would be the best.

2) Increase the content-length header anyway and append instead of
prepending (possibly spaces instead of text fragment). Possible, but not
the best option.

3) Move the code in some other, more appropriate function? Any advice?

Thank you,
  Alex.

Ps. There was some mention on a list about a buffer that can be up to
16K large (before data is sent?), but it was quite out of context. Any
further info on that one would be good too.
Received on Tue Jun 13 2000 - 17:38:54 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:29 MST