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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors