Reply.h
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#ifndef _SQUID_SRC_HELPER_REPLY_H
10#define _SQUID_SRC_HELPER_REPLY_H
11
12#include "base/CbcPointer.h"
13#include "helper/forward.h"
15#include "helper/ResultCode.h"
16#include "MemBuf.h"
17#include "Notes.h"
18
19#include <ostream>
20
21namespace Helper
22{
23
29class Reply
30{
31private:
32 // copy are prohibited for now
35
36public:
37 explicit Reply(Helper::ResultCode res) : result(res), notes() {}
38
40 Reply();
41
42 const MemBuf &other() const {return other_.isNull() ? emptyBuf() : other_;};
43
51 // XXX: buf should be const but we may need strwordtok() and rfc1738_unescape()
52 //void parse(char *buf, size_t len);
53 void finalize();
54
55 bool accumulate(const char *buf, size_t len);
56
57public:
60
61 // list of key=value pairs the helper produced
63
66private:
67 void parseResponseKeys();
68
70 const MemBuf &emptyBuf() const;
71
74};
75
76} // namespace Helper
77
78std::ostream &operator <<(std::ostream &os, const Helper::Reply &r);
79
80#endif /* _SQUID_SRC_HELPER_REPLY_H */
81
std::ostream & operator<<(std::ostream &os, const Helper::Reply &r)
Definition: Reply.cc:196
Reply & operator=(const Helper::Reply &r)
const MemBuf & emptyBuf() const
Return an empty MemBuf.
Definition: Reply.cc:187
NotePairs notes
Definition: Reply.h:62
Helper::ResultCode result
The helper response 'result' field.
Definition: Reply.h:59
Reply()
Creates a NULL reply.
Definition: Reply.cc:19
const MemBuf & other() const
Definition: Reply.h:42
Reply(const Helper::Reply &r)
Helper::ReservationId reservationId
The stateful replies should include the reservation ID.
Definition: Reply.h:65
void finalize()
Definition: Reply.cc:38
bool accumulate(const char *buf, size_t len)
Definition: Reply.cc:25
Reply(Helper::ResultCode res)
Definition: Reply.h:37
MemBuf other_
the remainder of the line
Definition: Reply.h:73
void parseResponseKeys()
Definition: Reply.cc:155
a (temporary) lock on a (stateful) helper channel
Definition: ReservationId.h:18
Definition: MemBuf.h:24
int isNull() const
Definition: MemBuf.cc:145
helper protocol primitives
Definition: helper.h:36
ResultCode
enumeration value for the helper response 'result' field.
Definition: ResultCode.h:16

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors