stub_libhttp.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2020 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 #include "squid.h"
10 #include "client_side.h"
11 #include "comm/Connection.h"
12 #include "SquidConfig.h"
13 
14 #define STUB_API "http/libhttp.la"
15 #include "tests/STUB.h"
16 
18 namespace Http
19 {
20 // XXX: use C++11 initialization for this class
22  value(-1),
23  headerWideProblem(nullptr),
24  debugLevel(Config.onoff.relaxed_header_parser <= 0 ? DBG_IMPORTANT : 2),
25  sawBad(false),
26  needsSanitizing(false),
27  sawGood(false),
28  prohibitedAndIgnored_(nullptr)
29 {
30 }
32 bool ContentLengthInterpreter::goodSuffix(const char *, const char * const) const STUB_RETVAL(false)
33 bool ContentLengthInterpreter::checkValue(const char *, const int) STUB_RETVAL(false)
35 }
36 
37 #include "http/Message.h"
38 namespace Http
39 {
42 void Message::packInto(Packable *, bool) const STUB
43 void Message::setContentLength(int64_t) STUB
45 void Message::putCc(const HttpHdrCc *) STUB
46 bool Message::parse(const char *, const size_t, bool, Http::StatusCode *) STUB_RETVAL(false)
47 bool Message::parseCharBuf(const char *, ssize_t) STUB_RETVAL(false)
48 int Message::httpMsgParseStep(const char *, int, int) STUB_RETVAL(-1)
49 int Message::httpMsgParseError() STUB_RETVAL(0)
50 void Message::firstLineBuf(MemBuf&) STUB
51 void Message::hdrCacheInit() STUB
52 bool Message::parseHeader(Http1::Parser &, Http::ContentLengthInterpreter &) STUB_RETVAL(false)
53 }
54 
55 #include "http/MethodType.h"
56 namespace Http
57 {
58 const SBuf MethodType_sb[1] = {SBuf()};
59 }
60 
61 #include "http/RegisteredHeaders.h"
62 namespace Http
63 {
68 const HeaderTableRecord& HeaderLookupTable_t::lookup(const char *, const std::size_t) const STUB_RETVAL(BadHdr)
69 const HeaderLookupTable_t HeaderLookupTable;
70 }
71 std::ostream &operator<< (std::ostream&os, Http::HdrType) STUB_RETVAL(os)
72 
73 #include "http/RequestMethod.h"
76 const SBuf &HttpRequestMethod::image() const STUB_RETVAL(theImage)
77 bool HttpRequestMethod::isHttpSafe() const STUB_RETVAL(false)
78 bool HttpRequestMethod::isIdempotent() const STUB_RETVAL(false)
79 bool HttpRequestMethod::respMaybeCacheable() const STUB_RETVAL(false)
80 bool HttpRequestMethod::shouldInvalidate() const STUB_RETVAL(false)
81 bool HttpRequestMethod::purgesOthers() const STUB_RETVAL(false)
82 
83 #include "http/StatusCode.h"
84 namespace Http
85 {
86 const char *StatusCodeString(const Http::StatusCode) STUB_RETVAL(nullptr)
87 }
88 
89 #include "http/StatusLine.h"
90 namespace Http
91 {
93 void StatusLine::clean() STUB
94 void StatusLine::set(const AnyP::ProtocolVersion &, Http::StatusCode, const char *) STUB
95 const char *StatusLine::reason() const STUB_RETVAL(nullptr)
96 void StatusLine::packInto(Packable *) const STUB
97 bool StatusLine::parse(const String &, const char *, const char *) STUB_RETVAL(false)
98 }
99 
100 #include "http/Stream.h"
101 namespace Http
102 {
106 bool Stream::startOfOutput() const STUB
107 void Stream::writeComplete(size_t) STUB
108 void Stream::pullData() STUB
109 bool Stream::multipartRangeRequest() const STUB_RETVAL(false)
110 int64_t Stream::getNextRangeOffset() const STUB_RETVAL(-1)
111 bool Stream::canPackMoreRanges() const STUB_RETVAL(false)
112 size_t Stream::lengthToSend(Range<int64_t> const &) const STUB_RETVAL(0)
113 clientStream_status_t Stream::socketState() STUB_RETVAL(STREAM_NONE)
114 void Stream::sendStartOfMessage(HttpReply *, StoreIOBuffer) STUB
115 void Stream::sendBody(StoreIOBuffer) STUB
116 void Stream::noteSentBodyBytes(size_t) STUB
117 void Stream::buildRangeHeader(HttpReply *) STUB
118 clientStreamNode *Stream::getTail() const STUB_RETVAL(nullptr)
119 clientStreamNode *Stream::getClientReplyContext() const STUB_RETVAL(nullptr)
120 ConnStateData *Stream::getConn() const STUB_RETVAL(nullptr)
121 void Stream::noteIoError(const int) STUB
122 void Stream::finished() STUB
123 void Stream::initiateClose(const char *) STUB
124 void Stream::deferRecipientForLater(clientStreamNode *, HttpReply *, StoreIOBuffer) STUB
125 }
126 
int relaxed_header_parser
Definition: SquidConfig.h:321
void packInto(Packable *, bool full_uri) const
produce a message copy, except for a few connection-specific settings
Definition: Message.cc:278
bool goodSuffix(const char *suffix, const char *const end) const
checks whether all characters after the Content-Length are allowed
const char * StatusCodeString(const Http::StatusCode status)
Definition: StatusCode.cc:14
void registerWithConn()
register this stream with the Server
Definition: Stream.cc:52
#define STUB_RETVAL(x)
Definition: STUB.h:41
@ STREAM_NONE
Definition: enums.h:126
virtual ~Message()
Definition: Message.cc:28
Definition: SBuf.h:86
void init()
reset this status-line back to empty state
Definition: StatusLine.cc:17
const SBuf & image() const
static struct node * parse(FILE *fp)
Definition: parse.c:995
StatusCode
Definition: StatusCode.h:20
Definition: forward.h:21
#define DBG_IMPORTANT
Definition: Debug.h:46
int const char size_t
Definition: stub_liblog.cc:86
Definition: Range.h:18
bool persistent() const
Definition: Message.cc:261
void setContentLength(int64_t)
[re]sets Content-Length header and cached value
Definition: Message.cc:253
Definition: forward.h:14
Generic protocol-agnostic parsing tools.
Definition: RequestParser.h:15
Definition: MemBuf.h:23
const SBuf MethodType_sb[]
Definition: stub_libhttp.cc:58
Stream(const Comm::ConnectionPointer &aConn, ClientHttpRequest *aReq)
construct with HTTP/1.x details
Definition: Stream.cc:23
const HeaderTableRecord & lookup(const char *buf, const std::size_t len) const
look record type up by name (C-string and length)
void HttpRequestMethodXXX(char const *)
#define STUB
macro to stub a void function.
Definition: STUB.h:33
struct SquidConfig::@112 onoff
bool checkValue(const char *start, const int size)
const HeaderLookupTable_t HeaderLookupTable
bool checkList(const String &list)
handles Content-Length: a, b, c
std::ostream & operator<<(std::ostream &os, Http::HdrType) STUB_RETVAL(os) HttpRequestMethod
Definition: stub_libhttp.cc:71
#define STUB_NOP
Definition: STUB.h:37
clientStream_status_t
Definition: enums.h:125
Message(http_hdr_owner_type)
Definition: Message.cc:23
#define false
Definition: GnuRegex.c:233
class SquidConfig Config
Definition: SquidConfig.cc:12
http_hdr_owner_type
Definition: HttpHeader.h:31
AnyP::ProtocolVersion ProtocolVersion(unsigned int aMajor, unsigned int aMinor)
HTTP version label information.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors