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 
17 namespace 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 }
31 bool ContentLengthInterpreter::goodSuffix(const char *, const char * const) const STUB_RETVAL(false)
32 bool ContentLengthInterpreter::checkValue(const char *, const int) STUB_RETVAL(false)
34 }
35 
36 #include "http/Message.h"
37 namespace Http
38 {
39 Message::Message(const http_hdr_owner_type owner): header(owner) {STUB}
40 Message::~Message() {STUB}
41 void Message::packInto(Packable *, bool) const STUB
42 void Message::setContentLength(int64_t) STUB
43 bool Message::persistent() const STUB_RETVAL(false)
44 void Message::putCc(const HttpHdrCc &) STUB
45 bool Message::parse(const char *, const size_t, bool, Http::StatusCode *) STUB_RETVAL(false)
46 bool Message::parseCharBuf(const char *, ssize_t) STUB_RETVAL(false)
47 int Message::httpMsgParseStep(const char *, int, int) STUB_RETVAL(-1)
48 int Message::httpMsgParseError() STUB_RETVAL(0)
49 void Message::firstLineBuf(MemBuf&) STUB
50 void Message::hdrCacheInit() STUB
51 bool Message::parseHeader(Http1::Parser &, Http::ContentLengthInterpreter &) STUB_RETVAL(false)
52 }
53 
54 #include "http/MethodType.h"
55 namespace Http
56 {
57 const SBuf MethodType_sb[1] = {SBuf()};
58 }
59 
60 #include "http/RegisteredHeaders.h"
61 namespace Http
62 {
66 const HeaderTableRecord& HeaderLookupTable_t::lookup(const char *, const std::size_t) const STUB_RETVAL(BadHdr)
67 const HeaderLookupTable_t HeaderLookupTable;
68 }
69 std::ostream &Http::operator <<(std::ostream &os, HdrType) STUB_RETVAL(os)
70 
71 #include "http/RequestMethod.h"
74 const SBuf &HttpRequestMethod::image() const STUB_RETVAL(theImage)
75 bool HttpRequestMethod::isHttpSafe() const STUB_RETVAL(false)
76 bool HttpRequestMethod::isIdempotent() const STUB_RETVAL(false)
77 bool HttpRequestMethod::respMaybeCacheable() const STUB_RETVAL(false)
78 bool HttpRequestMethod::shouldInvalidate() const STUB_RETVAL(false)
79 bool HttpRequestMethod::purgesOthers() const STUB_RETVAL(false)
80 
81 #include "http/StatusCode.h"
82 namespace Http
83 {
84 const char *StatusCodeString(const Http::StatusCode) STUB_RETVAL(nullptr)
85 }
86 
87 #include "http/StatusLine.h"
88 namespace Http
89 {
91 void StatusLine::clean() STUB
92 void StatusLine::set(const AnyP::ProtocolVersion &, Http::StatusCode, const char *) STUB
93 const char *StatusLine::reason() const STUB_RETVAL(nullptr)
94 size_t StatusLine::packedLength() const STUB_RETVAL(0)
95 void StatusLine::packInto(Packable *) const STUB
96 bool StatusLine::parse(const String &, const char *, const char *) STUB_RETVAL(false)
97 }
98 
99 #include "http/Stream.h"
100 namespace Http
101 {
105 bool Stream::startOfOutput() const STUB
106 void Stream::writeComplete(size_t) STUB
107 void Stream::pullData() STUB
108 bool Stream::multipartRangeRequest() const STUB_RETVAL(false)
109 int64_t Stream::getNextRangeOffset() const STUB_RETVAL(-1)
110 bool Stream::canPackMoreRanges() const STUB_RETVAL(false)
111 size_t Stream::lengthToSend(Range<int64_t> const &) const STUB_RETVAL(0)
112 clientStream_status_t Stream::socketState() STUB_RETVAL(STREAM_NONE)
113 void Stream::sendStartOfMessage(HttpReply *, StoreIOBuffer) STUB
114 void Stream::sendBody(StoreIOBuffer) STUB
115 void Stream::noteSentBodyBytes(size_t) STUB
116 void Stream::buildRangeHeader(HttpReply *) STUB
117 clientStreamNode *Stream::getTail() const STUB_RETVAL(nullptr)
118 clientStreamNode *Stream::getClientReplyContext() const STUB_RETVAL(nullptr)
119 ConnStateData *Stream::getConn() const STUB_RETVAL(nullptr)
120 void Stream::noteIoError(const Error &, const LogTagsErrors &) STUB
121 void Stream::finished() STUB
122 void Stream::initiateClose(const char *) STUB
123 void Stream::deferRecipientForLater(clientStreamNode *, HttpReply *, StoreIOBuffer) STUB
124 }
125 
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:15
void registerWithConn()
register this stream with the Server
Definition: Stream.cc:53
#define STUB_RETVAL(x)
Definition: STUB.h:42
@ STREAM_NONE
Definition: enums.h:121
Definition: SBuf.h:93
~Stream() override
Definition: Stream.cc:40
void init()
reset this status-line back to empty state
Definition: StatusLine.cc:22
const SBuf & image() const
static struct node * parse(FILE *fp)
Definition: parse.c:965
StatusCode
Definition: StatusCode.h:20
Definition: forward.h:17
static int persistent
int const char size_t
Definition: stub_liblog.cc:83
a transaction problem
Definition: Error.h:27
Definition: Range.h:18
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:57
Stream(const Comm::ConnectionPointer &aConn, ClientHttpRequest *aReq)
construct with HTTP/1.x details
Definition: Stream.cc:24
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:34
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 &, const TunnelerAnswer &)
#define STUB_NOP
Definition: STUB.h:38
clientStream_status_t
Definition: enums.h:120
#define DBG_IMPORTANT
Definition: Stream.h:38
Message(http_hdr_owner_type)
Definition: Message.cc:22
common part of ParseBws() and ParseStrctBws()
Definition: forward.h:17
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