[MERGE] eCAP support, part 2: libecap integration, squid.conf

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 29 Sep 2008 02:28:41 -0600

Hello,

    eCAP code needs polishing and enhancement but appears to work for a
few targeted cases. I will keep working on this, but would like to see
the current code committed so that users working on eCAP modules can
test and provide more specific feedback. The libecap library will be
published as well, of course. If there are no objections, I plan to do
both by the end of today so that we remain on Amos' schedule.

Since Part1 code took care of most core integration issues, this phase
does not affect Squid core much. I have documented the core changes in
the draft commit message below. I will try to commit those separately
unless it is a bad idea from bzr management point of view.

Finally, I kept eCAP files in the directory used for Part1 commit to
minimize the changes. They all will be moved during the source layout
polishing project, which is already underway.

Thank you,

Alex.
bb:approve

------------- draft commit message --------------

eCAP support, part 2: Implemented libecap interfaces, added eCAP
squid.conf options. Link with libecap when eCAP support is enabled.

Core changes inspired by and required for eCAP:

- Added HttpRequest::clone, completing HttpMsg::clone API. When ICAP is
  converted to use this, it should work faster for a common "no
  modifications" case because it would not have to print and parse the
  headers.

- The HttpMsg::body_pipe field is now copied when a message is cloned.
  I was not sure what the right thing to do there is. The field itself
  may be misplaced (it is not about the message structure or properties,
  but about the current body transfer state, but we lack a good place to
  store that...). To reduce the number of cloning exceptions, and since
  eCAP and probably ICAP code benefit from pipe copying, it is copied
  for now. It would not be too hard to change.

- Made TextException a std::exception child. This makes it easier to
  catch 3rd-party exceptions like those thrown by the standard library.
  Squid should continue to throw TextExceptions as before -- the
  throwing code remains correct. The catching code should catch
  std::exception -- I updated the relevant places I could find.

- Catch most exceptions in main() to report exceptions uncaught by Squid.
  This is for last resort reporting only -- the program would exit (usually
  with less information) if we did not catch these anyway. The code re-throws
  caught exceptions to reduce side effects of catching it, just in case. May
  need more work.

- Polished ServerStateData cleanup code: Moved more cleanup code from
  the destructor with its dangers of half-destroyed context to safe
  swanSong.

- Polished BodyPipe API. No runtime changes expected.

---------------------------

Received on Mon Sep 29 2008 - 08:28:44 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 01 2008 - 12:00:06 MDT