Request.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 "SquidTime.h"
14 
15 namespace Helper
16 {
17 
18 class Request
19 {
21 
22 public:
23  Request(HLPCB *c, void *d, const char *b) :
24  buf(b ? xstrdup(b) : NULL),
25  callback(c),
27  placeholder(b == NULL),
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;
52  int retries;
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 
#define cbdataReferenceDone(var)
Definition: cbdata.h:350
void * data
Definition: Request.h:41
Request(HLPCB *c, void *d, const char *b)
Definition: Request.h:23
#define xstrdup
time_t squid_curtime
Definition: stub_time.cc:17
void HLPCB(void *, const Helper::Reply &)
Definition: forward.h:27
#define cbdataReference(var)
Definition: cbdata.h:341
uint64_t Id
Definition: Request.h:45
HLPCB * callback
Definition: Request.h:40
char * buf
Definition: Request.h:39
MEMPROXY_CLASS(Helper::Request)
#define xfree
struct timeval dispatch_time
Definition: Request.h:44
#define NULL
Definition: types.h:166
int placeholder
Definition: Request.h:43
bool timedOut(time_t timeout)
Definition: Request.h:53

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors