Squid Web Cache master
Loading...
Searching...
No Matches
Request.h
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#ifndef SQUID_SRC_HELPER_REQUEST_H
10#define SQUID_SRC_HELPER_REQUEST_H
11
12#include "cbdata.h"
13#include "helper/forward.h"
14#include "mem/AllocatorProxy.h"
15#include "time/gadgets.h"
16
17namespace Helper
18{
19
21{
23
24public:
25 Request(HLPCB *c, void *d, const char *b) :
26 buf(b ? xstrdup(b) : nullptr),
27 callback(c),
29 placeholder(b == nullptr),
30 Id(0),
31 retries(0)
32 {
33 memset(&dispatch_time, 0, sizeof(dispatch_time));
34 }
35
40
41 char *buf;
43 void *data;
44
45 int placeholder; /* if 1, this is a dummy request waiting for a stateful helper to become available */
46 struct timeval dispatch_time;
47 uint64_t Id;
55 bool timedOut(time_t timeout) {return (squid_curtime - dispatch_time.tv_sec) > timeout;}
56};
57
58} // namespace Helper
59
60#endif /* SQUID_SRC_HELPER_REQUEST_H */
61
time_t squid_curtime
#define cbdataReferenceDone(var)
Definition cbdata.h:357
#define cbdataReference(var)
Definition cbdata.h:348
HLPCB * callback
Definition Request.h:42
void * data
Definition Request.h:43
bool timedOut(time_t timeout)
Definition Request.h:55
MEMPROXY_CLASS(Helper::Request)
uint64_t Id
Definition Request.h:47
struct timeval dispatch_time
Definition Request.h:46
Request(HLPCB *c, void *d, const char *b)
Definition Request.h:25
void HLPCB(void *, const Helper::Reply &)
Definition forward.h:33
helper protocol primitives
Definition helper.h:39
#define xfree
#define xstrdup