]> git.ipfire.org Git - thirdparty/squid.git/commit - src/HttpRequest.cc
Added HttpRequest::clone, completing HttpMsg::clone API. When ICAP is
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 30 Sep 2008 16:59:13 +0000 (10:59 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 30 Sep 2008 16:59:13 +0000 (10:59 -0600)
commitfa0e61149575ba9c162e378250e0109344463424
treec78b72c741d8e251b3939623c76a1c698c731bb8
parent499183091662e7ce87704cfb72cbef838a0bb436
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.

TODO: Consider renaming the method since it does not produce an exact,
true replica. Some connection-related flags and peer settings are not
cloned because the clone is not always "attached" or "coming from"
the same connection (e.g., it is cloned for eCAP to modify). We may also
#ifdef the method if it is not needed outside of adaptation code.

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.
src/HttpMsg.h
src/HttpReply.cc
src/HttpRequest.cc
src/HttpRequest.h