Squid Web Cache master
Loading...
Searching...
No Matches
stub_libhttp.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 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
13#define STUB_API "http/libhttp.la"
14#include "tests/STUB.h"
15
17namespace Http
18{
19// XXX: use C++11 initialization for this class
21 value(-1),
22 headerWideProblem(nullptr),
23 debugLevel(DBG_IMPORTANT),
24 sawBad(false),
25 needsSanitizing(false),
26 sawGood(false),
27 prohibitedAndIgnored_(nullptr)
28{
29}
31bool ContentLengthInterpreter::goodSuffix(const char *, const char * const) const STUB_RETVAL(false)
32bool ContentLengthInterpreter::checkValue(const char *, const int) STUB_RETVAL(false)
34}
35
36#include "http/Message.h"
37namespace Http
38{
39Message::Message(const http_hdr_owner_type owner): header(owner) {STUB}
40Message::~Message() {STUB}
41void Message::packInto(Packable *, bool) const STUB
42void Message::setContentLength(int64_t) STUB
43bool Message::persistent() const STUB_RETVAL(false)
44void Message::putCc(const HttpHdrCc &) STUB
45bool Message::parse(const char *, const size_t, bool, Http::StatusCode *) STUB_RETVAL(false)
46bool Message::parseCharBuf(const char *, ssize_t) STUB_RETVAL(false)
47int Message::httpMsgParseStep(const char *, int, int) STUB_RETVAL(-1)
48int Message::httpMsgParseError() STUB_RETVAL(0)
49void Message::firstLineBuf(MemBuf&) STUB
50void Message::hdrCacheInit() STUB
51bool Message::parseHeader(Http1::Parser &, Http::ContentLengthInterpreter &) STUB_RETVAL(false)
52}
53
54#include "http/MethodType.h"
55namespace Http
56{
57const SBuf MethodType_sb[1] = {SBuf()};
58}
59
61namespace Http
62{
66const HeaderTableRecord& HeaderLookupTable_t::lookup(const char *, const std::size_t) const STUB_RETVAL(BadHdr)
67const HeaderLookupTable_t HeaderLookupTable;
68}
69std::ostream &Http::operator <<(std::ostream &os, HdrType) STUB_RETVAL(os)
70
71#include "http/RequestMethod.h"
74const SBuf &HttpRequestMethod::image() const STUB_RETVAL(theImage)
75bool HttpRequestMethod::isHttpSafe() const STUB_RETVAL(false)
76bool HttpRequestMethod::isIdempotent() const STUB_RETVAL(false)
77bool HttpRequestMethod::respMaybeCacheable() const STUB_RETVAL(false)
78bool HttpRequestMethod::shouldInvalidate() const STUB_RETVAL(false)
79bool HttpRequestMethod::purgesOthers() const STUB_RETVAL(false)
80
81#include "http/StatusCode.h"
82namespace Http
83{
84const char *StatusCodeString(const Http::StatusCode) STUB_RETVAL(nullptr)
85}
86
87#include "http/StatusLine.h"
88namespace Http
89{
91void StatusLine::clean() STUB
92void StatusLine::set(const AnyP::ProtocolVersion &, Http::StatusCode, const char *) STUB
93const char *StatusLine::reason() const STUB_RETVAL(nullptr)
94size_t StatusLine::packedLength() const STUB_RETVAL(0)
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
http_hdr_owner_type
Definition HttpHeader.h:31
#define STUB
macro to stub a void function.
Definition STUB.h:34
#define STUB_NOP
Definition STUB.h:38
#define STUB_RETVAL(x)
Definition STUB.h:42
a transaction problem
Definition Error.h:27
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)
Message(http_hdr_owner_type)
Definition Message.cc:22
void init()
reset this status-line back to empty state
Definition StatusLine.cc:22
~Stream() override
Definition Stream.cc:40
void registerWithConn()
register this stream with the Server
Definition Stream.cc:53
Stream(const Comm::ConnectionPointer &aConn, ClientHttpRequest *aReq)
construct with HTTP/1.x details
Definition Stream.cc:24
Definition Range.h:19
Definition SBuf.h:94
#define DBG_IMPORTANT
Definition Stream.h:38
clientStream_status_t
Definition enums.h:120
@ STREAM_NONE
Definition enums.h:121
Definition forward.h:15
common part of ParseBws() and ParseStrctBws()
Definition forward.h:17
Definition forward.h:18
std::ostream & operator<<(std::ostream &, const TunnelerAnswer &)
StatusCode
Definition StatusCode.h:20
const SBuf MethodType_sb[]
AnyP::ProtocolVersion ProtocolVersion()
const HeaderLookupTable_t HeaderLookupTable
const char * StatusCodeString(const Http::StatusCode status)
Definition StatusCode.cc:15
Generic protocol-agnostic parsing tools.
static struct node * parse(FILE *fp)
Definition parse.c:965