Request.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_REQUEST_H
10#define _SQUID_SRC_HELPER_REQUEST_H
11
12#include "helper/forward.h"
13#include "time/gadgets.h"
14
15namespace Helper
16{
17
19{
21
22public:
23 Request(HLPCB *c, void *d, const char *b) :
24 buf(b ? xstrdup(b) : nullptr),
25 callback(c),
27 placeholder(b == nullptr),
28 Id(0),
29 retries(0)
30 {
31 memset(&dispatch_time, 0, sizeof(dispatch_time));
32 }
33
36 xfree(buf);
37 }
38
39 char *buf;
41 void *data;
42
43 int placeholder; /* if 1, this is a dummy request waiting for a stateful helper to become available */
44 struct timeval dispatch_time;
45 uint64_t Id;
53 bool timedOut(time_t timeout) {return (squid_curtime - dispatch_time.tv_sec) > timeout;}
54};
55
56} // namespace Helper
57
58#endif /* _SQUID_SRC_HELPER_REQUEST_H */
59
time_t squid_curtime
Definition: stub_libtime.cc:20
#define cbdataReferenceDone(var)
Definition: cbdata.h:350
#define cbdataReference(var)
Definition: cbdata.h:341
HLPCB * callback
Definition: Request.h:40
char * buf
Definition: Request.h:39
void * data
Definition: Request.h:41
bool timedOut(time_t timeout)
Definition: Request.h:53
MEMPROXY_CLASS(Helper::Request)
uint64_t Id
Definition: Request.h:45
struct timeval dispatch_time
Definition: Request.h:44
int placeholder
Definition: Request.h:43
Request(HLPCB *c, void *d, const char *b)
Definition: Request.h:23
void HLPCB(void *, const Helper::Reply &)
Definition: forward.h:27
helper protocol primitives
Definition: helper.h:36
#define xfree
#define xstrdup

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors