r2018 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Sep 25 09:06:19 CEST 2007


Author: phk
Date: 2007-09-25 09:06:18 +0200 (Tue, 25 Sep 2007)
New Revision: 2018

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_hash.c
   trunk/varnish-cache/bin/varnishd/cache_http.c
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
   trunk/varnish-cache/bin/varnishd/rfc2616.c
   trunk/varnish-cache/bin/varnishd/stevedore.c
Log:
Const'ifcation


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2007-09-25 06:56:23 UTC (rev 2017)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2007-09-25 07:06:18 UTC (rev 2018)
@@ -401,7 +401,7 @@
 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 */
@@ -435,9 +435,9 @@
 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);
@@ -449,9 +449,9 @@
 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);
@@ -460,11 +460,11 @@
 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);

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2007-09-25 06:56:23 UTC (rev 2017)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2007-09-25 07:06:18 UTC (rev 2018)
@@ -62,7 +62,7 @@
  */
 
 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;
@@ -337,7 +337,7 @@
 /*--------------------------------------------------------------------*/
 
 static void
-VBE_AddBackendMethod(struct backend_method *bem)
+VBE_AddBackendMethod(const struct backend_method *bem)
 {
 
 	if (bem->init != NULL)

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2007-09-25 06:56:23 UTC (rev 2017)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2007-09-25 07:06:18 UTC (rev 2018)
@@ -49,7 +49,7 @@
 /*--------------------------------------------------------------------*/
 
 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;

Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2007-09-25 06:56:23 UTC (rev 2017)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2007-09-25 07:06:18 UTC (rev 2018)
@@ -67,7 +67,7 @@
 
 /* Precreate an objhead and object for later use */
 void
-HSH_Prealloc(struct sess *sp)
+HSH_Prealloc(const struct sess *sp)
 {
 	struct worker *w;
 
@@ -110,7 +110,7 @@
 }
 
 int
-HSH_Compare(struct sess *sp, struct objhead *obj)
+HSH_Compare(const struct sess *sp, const struct objhead *obj)
 {
 	int i;
 	unsigned u, v;
@@ -138,7 +138,7 @@
 }
 
 void
-HSH_Copy(struct sess *sp, struct objhead *obj)
+HSH_Copy(struct sess *sp, const struct objhead *obj)
 {
 	unsigned u, v;
 	char *b;

Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2007-09-25 06:56:23 UTC (rev 2017)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2007-09-25 07:06:18 UTC (rev 2018)
@@ -79,7 +79,7 @@
 };
 
 static enum shmlogtag
-http2shmlog(struct http *hp, enum httptag t)
+http2shmlog(const struct http *hp, enum httptag t)
 {
 
 	CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
@@ -89,7 +89,7 @@
 }
 
 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);
@@ -174,7 +174,7 @@
 
 
 static int
-http_IsHdr(struct http_hdr *hh, const char *hdr)
+http_IsHdr(const struct http_hdr *hh, const char *hdr)
 {
 	unsigned l;
 
@@ -191,7 +191,7 @@
 /*--------------------------------------------------------------------*/
 
 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;
 
@@ -210,7 +210,7 @@
 }
 
 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;
@@ -234,7 +234,7 @@
 /*--------------------------------------------------------------------*/
 
 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;
@@ -373,7 +373,7 @@
 /*--------------------------------------------------------------------*/
 
 int
-http_GetStatus(struct http *hp)
+http_GetStatus(const struct http *hp)
 {
 
 	AN(hp->hd[HTTP_HDR_STATUS].b);
@@ -382,14 +382,14 @@
 }
 
 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);
@@ -704,7 +704,7 @@
 }
 
 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);
@@ -715,7 +715,7 @@
 }
 
 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);
@@ -732,7 +732,7 @@
 }
 
 void
-http_CopyResp(struct http *to, struct http *fm)
+http_CopyResp(struct http *to, const struct http *fm)
 {
 
 	CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
@@ -756,7 +756,7 @@
 }
 
 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);
@@ -776,7 +776,7 @@
 /*--------------------------------------------------------------------*/
 
 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;
 

Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2007-09-25 06:56:23 UTC (rev 2017)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2007-09-25 07:06:18 UTC (rev 2018)
@@ -75,7 +75,7 @@
 /*--------------------------------------------------------------------*/
 
 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;
 

Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/rfc2616.c	2007-09-25 06:56:23 UTC (rev 2017)
+++ trunk/varnish-cache/bin/varnishd/rfc2616.c	2007-09-25 07:06:18 UTC (rev 2018)
@@ -99,7 +99,7 @@
 #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;

Modified: trunk/varnish-cache/bin/varnishd/stevedore.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.c	2007-09-25 06:56:23 UTC (rev 2017)
+++ trunk/varnish-cache/bin/varnishd/stevedore.c	2007-09-25 07:06:18 UTC (rev 2018)
@@ -92,7 +92,7 @@
 }
 
 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);




More information about the varnish-commit mailing list