void VBE_UpdateHealth(struct sess *sp, struct vbe_conn *, int);
/* convenience functions for backend methods */
-int VBE_TryConnect(struct sess *sp, struct addrinfo *ai);
+int VBE_TryConnect(const struct sess *sp, const struct addrinfo *ai);
int VBE_CheckFd(int fd);
/* cache_backend_simple.c */
int Fetch(struct sess *sp);
/* cache_hash.c */
-void HSH_Prealloc(struct sess *sp);
-int HSH_Compare(struct sess *sp, struct objhead *o);
-void HSH_Copy(struct sess *sp, struct objhead *o);
+void HSH_Prealloc(const struct sess *sp);
+int HSH_Compare(const struct sess *sp, const struct objhead *o);
+void HSH_Copy(struct sess *sp, const struct objhead *o);
struct object *HSH_Lookup(struct sess *sp);
void HSH_Unbusy(struct object *o);
void HSH_Ref(struct object *o);
void HTTP_Init(void);
void http_ClrHeader(struct http *to);
unsigned http_Write(struct worker *w, struct http *hp, int resp);
-void http_CopyResp(struct http *to, struct http *fm);
+void http_CopyResp(struct http *to, const struct http *fm);
void http_SetResp(struct http *to, const char *proto, const char *status, const char *response);
-void http_FilterFields(struct worker *w, int fd, struct http *to, struct http *fm, unsigned how);
+void http_FilterFields(struct worker *w, int fd, struct http *to, const struct http *fm, unsigned how);
void http_FilterHeader(struct sess *sp, unsigned how);
void http_PutProtocol(struct worker *w, int fd, struct http *to, const char *protocol);
void http_PutStatus(struct worker *w, int fd, struct http *to, int status);
void http_SetHeader(struct worker *w, int fd, struct http *to, const char *hdr);
void http_SetH(struct http *to, unsigned n, const char *fm);
void http_Setup(struct http *ht, void *space, unsigned len);
-int http_GetHdr(struct http *hp, const char *hdr, char **ptr);
-int http_GetHdrField(struct http *hp, const char *hdr, const char *field, char **ptr);
-int http_GetStatus(struct http *hp);
-const char *http_GetReq(struct http *hp);
-const char *http_GetProto(struct http *hp);
+int http_GetHdr(const struct http *hp, const char *hdr, char **ptr);
+int http_GetHdrField(const struct http *hp, const char *hdr, const char *field, char **ptr);
+int http_GetStatus(const struct http *hp);
+const char *http_GetReq(const struct http *hp);
+const char *http_GetProto(const struct http *hp);
int http_HdrIs(struct http *hp, const char *hdr, const char *val);
int http_GetTail(struct http *hp, unsigned len, char **b, char **e);
int http_Read(struct http *hp, int fd, void *b, unsigned len);
*/
int
-VBE_TryConnect(struct sess *sp, struct addrinfo *ai)
+VBE_TryConnect(const struct sess *sp, const struct addrinfo *ai)
{
struct sockaddr_storage ss;
int fam, sockt, proto;
/*--------------------------------------------------------------------*/
static void
-VBE_AddBackendMethod(struct backend_method *bem)
+VBE_AddBackendMethod(const struct backend_method *bem)
{
if (bem->init != NULL)
/*--------------------------------------------------------------------*/
static int
-fetch_straight(struct sess *sp, int fd, struct http *hp, char *b)
+fetch_straight(struct sess *sp, int fd, struct http *hp, const char *b)
{
int i;
unsigned char *p;
/* Precreate an objhead and object for later use */
void
-HSH_Prealloc(struct sess *sp)
+HSH_Prealloc(const struct sess *sp)
{
struct worker *w;
}
int
-HSH_Compare(struct sess *sp, struct objhead *obj)
+HSH_Compare(const struct sess *sp, const struct objhead *obj)
{
int i;
unsigned u, v;
}
void
-HSH_Copy(struct sess *sp, struct objhead *obj)
+HSH_Copy(struct sess *sp, const struct objhead *obj)
{
unsigned u, v;
char *b;
};
static enum shmlogtag
-http2shmlog(struct http *hp, enum httptag t)
+http2shmlog(const struct http *hp, enum httptag t)
{
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
}
static void
-WSLH(struct worker *w, enum httptag t, unsigned fd, struct http *hp, int hdr)
+WSLH(struct worker *w, enum httptag t, unsigned fd, const struct http *hp, int hdr)
{
WSLR(w, http2shmlog(hp, t), fd, hp->hd[hdr].b, hp->hd[hdr].e);
static int
-http_IsHdr(struct http_hdr *hh, const char *hdr)
+http_IsHdr(const struct http_hdr *hh, const char *hdr)
{
unsigned l;
/*--------------------------------------------------------------------*/
static unsigned
-http_findhdr(struct http *hp, unsigned l, const char *hdr)
+http_findhdr(const struct http *hp, unsigned l, const char *hdr)
{
unsigned u;
}
int
-http_GetHdr(struct http *hp, const char *hdr, char **ptr)
+http_GetHdr(const struct http *hp, const char *hdr, char **ptr)
{
unsigned u, l;
char *p;
/*--------------------------------------------------------------------*/
int
-http_GetHdrField(struct http *hp, const char *hdr, const char *field, char **ptr)
+http_GetHdrField(const struct http *hp, const char *hdr, const char *field, char **ptr)
{
char *h;
int fl;
/*--------------------------------------------------------------------*/
int
-http_GetStatus(struct http *hp)
+http_GetStatus(const struct http *hp)
{
AN(hp->hd[HTTP_HDR_STATUS].b);
}
const char *
-http_GetProto(struct http *hp)
+http_GetProto(const struct http *hp)
{
AN(hp->hd[HTTP_HDR_PROTO].b);
return (hp->hd[HTTP_HDR_PROTO].b);
}
const char *
-http_GetReq(struct http *hp)
+http_GetReq(const struct http *hp)
{
AN(hp->hd[HTTP_HDR_REQ].b);
return (hp->hd[HTTP_HDR_REQ].b);
}
static void
-http_copyh(struct http *to, struct http *fm, unsigned n)
+http_copyh(struct http *to, const struct http *fm, unsigned n)
{
assert(n < HTTP_HDR_MAX);
}
static void
-http_copyreq(struct http *to, struct http *fm, int transparent)
+http_copyreq(struct http *to, const struct http *fm, int transparent)
{
CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
}
void
-http_CopyResp(struct http *to, struct http *fm)
+http_CopyResp(struct http *to, const struct http *fm)
{
CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
}
static void
-http_copyheader(struct worker *w, int fd, struct http *to, struct http *fm, unsigned n)
+http_copyheader(struct worker *w, int fd, struct http *to, const struct http *fm, unsigned n)
{
CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
/*--------------------------------------------------------------------*/
void
-http_FilterFields(struct worker *w, int fd, struct http *to, struct http *fm, unsigned how)
+http_FilterFields(struct worker *w, int fd, struct http *to, const struct http *fm, unsigned how)
{
unsigned u;
/*--------------------------------------------------------------------*/
static struct http *
-vrt_selecthttp(struct sess *sp, enum gethdr_e where)
+vrt_selecthttp(const struct sess *sp, enum gethdr_e where)
{
struct http *hp;
#endif
static double
-RFC2616_Ttl(struct sess *sp, struct http *hp, struct object *obj)
+RFC2616_Ttl(const struct sess *sp, struct http *hp, struct object *obj)
{
int retirement_age;
unsigned u1, u2;
}
static int
-cmp_storage(struct stevedore *s, const char *p, const char *q)
+cmp_storage(const struct stevedore *s, const const char *p, const char *q)
{
if (strlen(s->name) != q - p)
return (1);