squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
src
adaptation
icap
InOut.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3
*
4
* Squid software is distributed under GPLv2+ license and includes
5
* contributions from numerous individuals and organizations.
6
* Please see the COPYING and CONTRIBUTORS files for details.
7
*/
8
9
#ifndef SQUID_ICAPINOUT_H
10
#define SQUID_ICAPINOUT_H
11
12
#include "
HttpReply.h
"
13
14
// IcapInOut manages a pointer to the HTTP message being worked on.
15
// For HTTP responses, request header information is also available
16
// as the "cause". ICAP transactions use this class to store virgin
17
// and adapted HTTP messages.
18
19
namespace
Adaptation
20
{
21
namespace
Icap
22
{
23
24
class
InOut
25
{
26
27
public
:
28
// TODO: s/Header/Message/i ?
29
typedef
Http::Message
Header
;
30
31
InOut
():
header
(nullptr),
cause
(nullptr) {}
32
33
~InOut
() {
34
HTTPMSGUNLOCK
(
cause
);
35
HTTPMSGUNLOCK
(
header
);
36
}
37
38
void
setCause
(
HttpRequest
*r) {
39
if
(r) {
40
HTTPMSGUNLOCK
(
cause
);
41
cause
= r;
42
HTTPMSGLOCK
(
cause
);
43
}
else
{
44
assert
(!
cause
);
45
}
46
}
47
48
void
setHeader
(
Header
*h) {
49
HTTPMSGUNLOCK
(
header
);
50
header
= h;
51
HTTPMSGLOCK
(
header
);
52
body_pipe
=
header
->
body_pipe
;
53
}
54
55
public
:
56
// virgin or adapted message being worked on
57
Header
*
header
;
// parsed HTTP status/request line and headers
58
59
// HTTP request header for HTTP responses (the cause of the response)
60
HttpRequest
*
cause
;
61
62
// Copy of header->body_pipe, in case somebody moves the original.
63
BodyPipe::Pointer
body_pipe
;
64
};
65
66
}
// namespace Icap
67
}
// namespace Adaptation
68
69
#endif
/* SQUID_ICAPINOUT_H */
70
HttpReply.h
assert
#define assert(EX)
Definition:
assert.h:17
Adaptation::Icap::InOut
Definition:
InOut.h:25
Adaptation::Icap::InOut::cause
HttpRequest * cause
Definition:
InOut.h:60
Adaptation::Icap::InOut::setHeader
void setHeader(Header *h)
Definition:
InOut.h:48
Adaptation::Icap::InOut::header
Header * header
Definition:
InOut.h:57
Adaptation::Icap::InOut::setCause
void setCause(HttpRequest *r)
Definition:
InOut.h:38
Adaptation::Icap::InOut::Header
Http::Message Header
Definition:
InOut.h:29
Adaptation::Icap::InOut::body_pipe
BodyPipe::Pointer body_pipe
Definition:
InOut.h:63
Adaptation::Icap::InOut::~InOut
~InOut()
Definition:
InOut.h:33
Adaptation::Icap::InOut::InOut
InOut()
Definition:
InOut.h:31
HttpRequest
Definition:
HttpRequest.h:49
Http::Message
common parts of HttpRequest and HttpReply
Definition:
Message.h:26
Http::Message::body_pipe
BodyPipe::Pointer body_pipe
optional pipeline to receive message body
Definition:
Message.h:97
RefCount< BodyPipe >
HTTPMSGUNLOCK
void HTTPMSGUNLOCK(M *&a)
Definition:
Message.h:150
HTTPMSGLOCK
void HTTPMSGLOCK(Http::Message *a)
Definition:
Message.h:161
Adaptation
Definition:
AccessCheck.h:25
Introduction
About Squid
Why Squid?
Squid Developers
How to Donate
How to Help Out
Getting Squid
Squid Source Packages
Squid Deployment Case-Studies
Squid Software Foundation
Documentation
Quick Setup
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
gr
il
pl
...
full list
FTP Package Archive