r2041 - in trunk/varnish-cache: bin/varnishd include lib/libvcl
phk at projects.linpro.no
phk at projects.linpro.no
Tue Sep 25 13:11:15 CEST 2007
Author: phk
Date: 2007-09-25 13:11:15 +0200 (Tue, 25 Sep 2007)
New Revision: 2041
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
trunk/varnish-cache/bin/varnishd/cache_backend.c
trunk/varnish-cache/bin/varnishd/cache_backend_random.c
trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c
trunk/varnish-cache/bin/varnishd/cache_backend_simple.c
trunk/varnish-cache/bin/varnishd/cache_http.c
trunk/varnish-cache/bin/varnishd/cache_pool.c
trunk/varnish-cache/bin/varnishd/cache_session.c
trunk/varnish-cache/bin/varnishd/cache_vary.c
trunk/varnish-cache/bin/varnishd/cache_ws.c
trunk/varnish-cache/bin/varnishd/hash_classic.c
trunk/varnish-cache/bin/varnishd/hash_simple_list.c
trunk/varnish-cache/bin/varnishd/hash_slinger.h
trunk/varnish-cache/bin/varnishd/mgt_child.c
trunk/varnish-cache/bin/varnishd/mgt_cli.c
trunk/varnish-cache/bin/varnishd/mgt_event.h
trunk/varnish-cache/bin/varnishd/rfc2616.c
trunk/varnish-cache/bin/varnishd/stevedore.c
trunk/varnish-cache/bin/varnishd/stevedore.h
trunk/varnish-cache/bin/varnishd/storage_file.c
trunk/varnish-cache/bin/varnishd/varnishd.c
trunk/varnish-cache/include/vrt.h
trunk/varnish-cache/lib/libvcl/vcc_backend.c
trunk/varnish-cache/lib/libvcl/vcc_compile.c
trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
Log:
Mega-Const'ification
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2007-09-25 11:11:15 UTC (rev 2041)
@@ -94,7 +94,7 @@
unsigned WS_Reserve(struct ws *ws, unsigned bytes);
void WS_Release(struct ws *ws, unsigned bytes);
void WS_ReleaseP(struct ws *ws, char *ptr);
-void WS_Assert(struct ws *ws);
+void WS_Assert(const struct ws *ws);
void WS_Reset(struct ws *ws);
char *WS_Alloc(struct ws *ws, unsigned bytes);
@@ -332,13 +332,13 @@
/* Backend method */
-typedef struct vbe_conn *vbe_getfd_f(struct sess *sp);
+typedef struct vbe_conn *vbe_getfd_f(const struct sess *sp);
typedef void vbe_close_f(struct worker *w, struct vbe_conn *vc);
typedef void vbe_recycle_f(struct worker *w, struct vbe_conn *vc);
typedef void vbe_init_f(void);
-typedef const char *vbe_gethostname_f(struct backend *);
-typedef void vbe_cleanup_f(struct backend *);
-typedef void vbe_updatehealth_f(struct sess *sp, struct vbe_conn *vc, int);
+typedef const char *vbe_gethostname_f(const struct backend *);
+typedef void vbe_cleanup_f(const struct backend *);
+typedef void vbe_updatehealth_f(const struct sess *sp, const struct vbe_conn *vc, int);
struct backend_method {
const char *name;
@@ -388,7 +388,7 @@
/* cache_backend.c */
void VBE_Init(void);
-struct vbe_conn *VBE_GetFd(struct sess *sp);
+struct vbe_conn *VBE_GetFd(const struct sess *sp);
void VBE_ClosedFd(struct worker *w, struct vbe_conn *vc);
void VBE_RecycleFd(struct worker *w, struct vbe_conn *vc);
struct bereq * VBE_new_bereq(void);
@@ -399,7 +399,7 @@
struct backend *VBE_NewBackend(struct backend_method *method);
struct vbe_conn *VBE_NewConn(void);
void VBE_ReleaseConn(struct vbe_conn *);
-void VBE_UpdateHealth(struct sess *sp, struct vbe_conn *, int);
+void VBE_UpdateHealth(const struct sess *sp, const struct vbe_conn *, int);
/* convenience functions for backend methods */
int VBE_TryConnect(const struct sess *sp, const struct addrinfo *ai);
@@ -449,7 +449,7 @@
const char *http_StatusMessage(int);
void HTTP_Init(void);
void http_ClrHeader(struct http *to);
-unsigned http_Write(struct worker *w, struct http *hp, int resp);
+unsigned http_Write(struct worker *w, const struct http *hp, int resp);
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, const struct http *fm, unsigned how);
@@ -493,14 +493,14 @@
void WRK_Reset(struct worker *w, int *fd);
unsigned WRK_Flush(struct worker *w);
unsigned WRK_Write(struct worker *w, const void *ptr, int len);
-unsigned WRK_WriteH(struct worker *w, struct http_hdr *hh, const char *suf);
+unsigned WRK_WriteH(struct worker *w, const struct http_hdr *hh, const char *suf);
#ifdef HAVE_SENDFILE
void WRK_Sendfile(struct worker *w, int fd, off_t off, unsigned len);
#endif /* HAVE_SENDFILE */
/* cache_session.c [SES] */
void SES_Init(void);
-struct sess *SES_New(struct sockaddr *addr, unsigned len);
+struct sess *SES_New(const struct sockaddr *addr, unsigned len);
void SES_Delete(struct sess *sp);
void SES_RefSrcAddr(struct sess *sp);
void SES_Charge(struct sess *sp);
@@ -530,8 +530,8 @@
void SYN_ErrorPage(struct sess *sp, int status, const char *reason, int ttl);
/* cache_vary.c */
-void VRY_Create(struct sess *sp);
-int VRY_Match(struct sess *sp, unsigned char *vary);
+void VRY_Create(const struct sess *sp);
+int VRY_Match(const struct sess *sp, const unsigned char *vary);
/* cache_vcl.c */
void VCL_Init(void);
@@ -554,7 +554,7 @@
#endif
/* rfc2616.c */
-int RFC2616_cache_policy(struct sess *sp, struct http *hp);
+int RFC2616_cache_policy(const struct sess *sp, const struct http *hp);
#if 1
#define MTX pthread_mutex_t
Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -73,7 +73,7 @@
}
static void
-vca_kev(struct kevent *kp)
+vca_kev(const struct kevent *kp)
{
int i, j;
struct sess *sp;
Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -267,7 +267,7 @@
/*--------------------------------------------------------------------*/
struct vbe_conn *
-VBE_GetFd(struct sess *sp)
+VBE_GetFd(const struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -314,7 +314,7 @@
* details and comments about this function.
*/
void
-VBE_UpdateHealth(struct sess *sp, struct vbe_conn *vc, int a)
+VBE_UpdateHealth(const struct sess *sp, const struct vbe_conn *vc, int a)
{
struct backend *b;
Modified: trunk/varnish-cache/bin/varnishd/cache_backend_random.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_random.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_random.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -84,7 +84,7 @@
*/
static int
-ber_conn_try_list(struct sess *sp, struct brspec *bs)
+ber_conn_try_list(const struct sess *sp, struct brspec *bs)
{
struct addrinfo *ai, *from;
int s, loops;
@@ -170,7 +170,7 @@
/*--------------------------------------------------------------------*/
static int
-ber_conn_try(struct sess *sp, struct backend *bp, struct brspec *bs)
+ber_conn_try(const struct sess *sp, struct backend *bp, struct brspec *bs)
{
int s;
@@ -217,7 +217,7 @@
*/
static struct vbe_conn *
-ber_nextfd(struct sess *sp)
+ber_nextfd(const struct sess *sp)
{
struct vbe_conn *vc;
struct backend *bp;
@@ -292,7 +292,7 @@
}
static struct vbe_conn *
-ber_GetFd(struct sess *sp)
+ber_GetFd(const struct sess *sp)
{
struct vbe_conn *vc;
unsigned n;
@@ -350,7 +350,7 @@
/*--------------------------------------------------------------------*/
static void
-ber_Cleanup(struct backend *b)
+ber_Cleanup(const struct backend *b)
{
struct ber *ber;
struct vbe_conn *vbe;
@@ -386,7 +386,7 @@
/* Will return the hostname of the first backend in the list */
static const char *
-ber_GetHostname(struct backend *b)
+ber_GetHostname(const struct backend *b)
{
struct ber *ber;
@@ -402,7 +402,7 @@
* towards neutral (0) as time passes
*/
static void
-ber_UpdateHealth(struct sess *sp, struct vbe_conn *vc, int add)
+ber_UpdateHealth(const struct sess *sp, const struct vbe_conn *vc, int add)
{
struct brspec *bs, *first;
struct ber *ber;
@@ -438,7 +438,7 @@
/*--------------------------------------------------------------------*/
void
-VRT_init_random_backend(struct backend **bp, struct vrt_random_backend *t)
+VRT_init_random_backend(struct backend **bp, const struct vrt_random_backend *t)
{
struct backend *b;
struct ber *ber;
Modified: trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -83,7 +83,7 @@
*/
static int
-brr_conn_try_list(struct sess *sp, struct bspec *bs)
+brr_conn_try_list(const struct sess *sp, struct bspec *bs)
{
struct addrinfo *ai, *from;
int s, loops;
@@ -169,7 +169,7 @@
/*--------------------------------------------------------------------*/
static int
-brr_conn_try(struct sess *sp, struct backend *bp, struct bspec *bs)
+brr_conn_try(const struct sess *sp, struct backend *bp, struct bspec *bs)
{
int s;
@@ -215,7 +215,7 @@
*/
static struct vbe_conn *
-brr_nextfd(struct sess *sp)
+brr_nextfd(const struct sess *sp)
{
struct vbe_conn *vc;
struct backend *bp;
@@ -277,7 +277,7 @@
}
static struct vbe_conn *
-brr_GetFd(struct sess *sp)
+brr_GetFd(const struct sess *sp)
{
struct vbe_conn *vc;
unsigned n;
@@ -335,7 +335,7 @@
/*--------------------------------------------------------------------*/
static void
-brr_Cleanup(struct backend *b)
+brr_Cleanup(const struct backend *b)
{
struct brr *brr;
struct vbe_conn *vbe;
@@ -371,7 +371,7 @@
/* Will return the hostname of the first backend in the list */
static const char *
-brr_GetHostname(struct backend *b)
+brr_GetHostname(const struct backend *b)
{
struct brr *brr;
@@ -387,7 +387,7 @@
* towards neutral (0) as time passes
*/
static void
-brr_UpdateHealth(struct sess *sp, struct vbe_conn *vc, int add)
+brr_UpdateHealth(const struct sess *sp, const struct vbe_conn *vc, int add)
{
struct bspec *bs, *first;
struct brr *brr;
@@ -424,7 +424,7 @@
/*--------------------------------------------------------------------*/
void
-VRT_init_round_robin_backend(struct backend **bp, struct vrt_round_robin_backend *t)
+VRT_init_round_robin_backend(struct backend **bp, const struct vrt_round_robin_backend *t)
{
struct backend *b;
struct brr *brr;
Modified: trunk/varnish-cache/bin/varnishd/cache_backend_simple.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_simple.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_simple.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -67,7 +67,7 @@
*/
static int
-bes_conn_try_list(struct sess *sp, struct bes *bes)
+bes_conn_try_list(const struct sess *sp, struct bes *bes)
{
struct addrinfo *ai, *from;
int s, loops;
@@ -154,7 +154,7 @@
/*--------------------------------------------------------------------*/
static int
-bes_conn_try(struct sess *sp, struct backend *bp)
+bes_conn_try(const struct sess *sp, struct backend *bp)
{
int s;
struct bes *bes;
@@ -200,7 +200,7 @@
*/
static struct vbe_conn *
-bes_nextfd(struct sess *sp)
+bes_nextfd(const struct sess *sp)
{
struct vbe_conn *vc;
struct backend *bp;
@@ -250,7 +250,7 @@
/*--------------------------------------------------------------------*/
static struct vbe_conn *
-bes_GetFd(struct sess *sp)
+bes_GetFd(const struct sess *sp)
{
struct vbe_conn *vc;
unsigned n;
@@ -309,7 +309,7 @@
/*--------------------------------------------------------------------*/
static void
-bes_Cleanup(struct backend *b)
+bes_Cleanup(const struct backend *b)
{
struct bes *bes;
struct vbe_conn *vbe;
@@ -334,7 +334,7 @@
/*--------------------------------------------------------------------*/
static const char *
-bes_GetHostname(struct backend *b)
+bes_GetHostname(const struct backend *b)
{
struct bes *bes;
@@ -357,7 +357,7 @@
/*--------------------------------------------------------------------*/
void
-VRT_init_simple_backend(struct backend **bp, struct vrt_simple_backend *t)
+VRT_init_simple_backend(struct backend **bp, const struct vrt_simple_backend *t)
{
struct backend *b;
struct bes *bes;
Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -986,7 +986,7 @@
/*--------------------------------------------------------------------*/
unsigned
-http_Write(struct worker *w, struct http *hp, int resp)
+http_Write(struct worker *w, const struct http *hp, int resp)
{
unsigned u, l;
Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -108,7 +108,7 @@
}
unsigned
-WRK_WriteH(struct worker *w, struct http_hdr *hh, const char *suf)
+WRK_WriteH(struct worker *w, const struct http_hdr *hh, const char *suf)
{
unsigned u;
Modified: trunk/varnish-cache/bin/varnishd/cache_session.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_session.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_session.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -209,7 +209,7 @@
/*--------------------------------------------------------------------*/
static void
-ses_sum_acct(struct acct *sum, struct acct *inc)
+ses_sum_acct(struct acct *sum, const struct acct *inc)
{
sum->sess += inc->sess;
@@ -256,7 +256,7 @@
/*--------------------------------------------------------------------*/
struct sess *
-SES_New(struct sockaddr *addr, unsigned len)
+SES_New(const struct sockaddr *addr, unsigned len)
{
struct sessmem *sm;
struct sess *sp;
Modified: trunk/varnish-cache/bin/varnishd/cache_vary.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vary.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_vary.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -61,7 +61,7 @@
#include "cache.h"
void
-VRY_Create(struct sess *sp)
+VRY_Create(const struct sess *sp)
{
char *v, *p, *q, *h, *e;
struct vsb *sb, *sbh;
@@ -129,7 +129,7 @@
}
int
-VRY_Match(struct sess *sp, unsigned char *vary)
+VRY_Match(const struct sess *sp, const unsigned char *vary)
{
char *h, *e;
int i, l, lh;
@@ -137,7 +137,7 @@
while (*vary) {
/* Look for header */
- i = http_GetHdr(sp->http, (char*)vary, &h);
+ i = http_GetHdr(sp->http, (const char*)vary, &h);
vary += *vary + 2;
/* Expected length of header (or 0xffff) */
Modified: trunk/varnish-cache/bin/varnishd/cache_ws.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_ws.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/cache_ws.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -46,7 +46,7 @@
#include "cache.h"
void
-WS_Assert(struct ws *ws)
+WS_Assert(const struct ws *ws)
{
assert(ws != NULL);
Modified: trunk/varnish-cache/bin/varnishd/hash_classic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_classic.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/hash_classic.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -119,7 +119,7 @@
*/
static struct objhead *
-hcl_lookup(struct sess *sp, struct objhead *noh)
+hcl_lookup(const struct sess *sp, struct objhead *noh)
{
struct objhead *roh;
struct hcl_entry *he, *he2;
@@ -213,7 +213,7 @@
*/
static int
-hcl_deref(struct objhead *oh)
+hcl_deref(const struct objhead *oh)
{
struct hcl_entry *he;
struct hcl_hd *hp;
Modified: trunk/varnish-cache/bin/varnishd/hash_simple_list.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_simple_list.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/hash_simple_list.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -71,7 +71,7 @@
*/
static struct objhead *
-hsl_lookup(struct sess *sp, struct objhead *nobj)
+hsl_lookup(const struct sess *sp, struct objhead *nobj)
{
struct hsl_entry *he, *he2;
int i;
@@ -116,7 +116,7 @@
*/
static int
-hsl_deref(struct objhead *obj)
+hsl_deref(const struct objhead *obj)
{
struct hsl_entry *he;
int ret;
Modified: trunk/varnish-cache/bin/varnishd/hash_slinger.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_slinger.h 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/hash_slinger.h 2007-09-25 11:11:15 UTC (rev 2041)
@@ -33,8 +33,8 @@
typedef int hash_init_f(const char *);
typedef void hash_start_f(void);
-typedef struct objhead *hash_lookup_f(struct sess *sp, struct objhead *nobj);
-typedef int hash_deref_f(struct objhead *obj);
+typedef struct objhead *hash_lookup_f(const struct sess *sp, struct objhead *nobj);
+typedef int hash_deref_f(const struct objhead *obj);
struct hash_slinger {
const char *name;
Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -81,7 +81,7 @@
/*--------------------------------------------------------------------*/
static int
-child_listener(struct ev *e, int what)
+child_listener(const struct ev *e, int what)
{
int i;
char buf[BUFSIZ];
@@ -105,7 +105,7 @@
/*--------------------------------------------------------------------*/
static int
-child_poker(struct ev *e, int what)
+child_poker(const struct ev *e, int what)
{
(void)e;
@@ -290,7 +290,7 @@
/*--------------------------------------------------------------------*/
static int
-mgt_sigchld(struct ev *e, int what)
+mgt_sigchld(const struct ev *e, int what)
{
int status;
pid_t r;
@@ -353,7 +353,7 @@
/*--------------------------------------------------------------------*/
static int
-mgt_sigint(struct ev *e, int what)
+mgt_sigint(const struct ev *e, int what)
{
(void)e;
Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_cli.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/mgt_cli.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -293,7 +293,7 @@
};
static int
-mgt_cli_callback(struct ev *e, int what)
+mgt_cli_callback(const struct ev *e, int what)
{
struct cli_port *cp;
char *p, *q;
@@ -391,7 +391,7 @@
}
static int
-telnet_accept(struct ev *ev, int what)
+telnet_accept(const struct ev *ev, int what)
{
struct sockaddr_storage addr;
socklen_t addrlen;
Modified: trunk/varnish-cache/bin/varnishd/mgt_event.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_event.h 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/mgt_event.h 2007-09-25 11:11:15 UTC (rev 2041)
@@ -36,7 +36,7 @@
struct ev;
struct evbase;
-typedef int ev_cb_f(struct ev *, int what);
+typedef int ev_cb_f(const struct ev *, int what);
struct ev {
unsigned magic;
Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/rfc2616.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/rfc2616.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -99,7 +99,7 @@
#endif
static double
-RFC2616_Ttl(const struct sess *sp, struct http *hp, struct object *obj)
+RFC2616_Ttl(const struct sess *sp, const struct http *hp, struct object *obj)
{
int retirement_age;
unsigned u1, u2;
@@ -163,7 +163,7 @@
}
int
-RFC2616_cache_policy(struct sess *sp, struct http *hp)
+RFC2616_cache_policy(const struct sess *sp, const struct http *hp)
{
int body = 0;
Modified: trunk/varnish-cache/bin/varnishd/stevedore.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/stevedore.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -72,7 +72,7 @@
}
void
-STV_trim(struct storage *st, size_t size)
+STV_trim(const struct storage *st, size_t size)
{
CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
@@ -82,7 +82,7 @@
}
void
-STV_free(struct storage *st)
+STV_free(const struct storage *st)
{
CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
Modified: trunk/varnish-cache/bin/varnishd/stevedore.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.h 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/stevedore.h 2007-09-25 11:11:15 UTC (rev 2041)
@@ -36,7 +36,7 @@
struct iovec;
typedef void storage_init_f(struct stevedore *, const char *spec);
-typedef void storage_open_f(struct stevedore *);
+typedef void storage_open_f(const struct stevedore *);
typedef struct storage *storage_alloc_f(struct stevedore *, size_t size);
typedef void storage_trim_f(const struct storage *, size_t size);
typedef void storage_free_f(const struct storage *);
@@ -56,7 +56,7 @@
};
struct storage *STV_alloc(struct sess *sp, size_t size);
-void STV_trim(struct storage *st, size_t size);
-void STV_free(struct storage *st);
+void STV_trim(const struct storage *st, size_t size);
+void STV_free(const struct storage *st);
void STV_add(const char *spec);
void STV_open(void);
Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -373,7 +373,7 @@
}
static void
-remfree(struct smf_sc *sc, struct smf *sp)
+remfree(const struct smf_sc *sc, struct smf *sp)
{
size_t b;
@@ -601,7 +601,7 @@
}
static void
-smf_open(struct stevedore *st)
+smf_open(const struct stevedore *st)
{
struct smf_sc *sc;
off_t fail = 1 << 30; /* XXX: where is OFF_T_MAX ? */
Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -77,7 +77,7 @@
/*--------------------------------------------------------------------*/
static int
-cmp_hash(struct hash_slinger *s, const char *p, const char *q)
+cmp_hash(const struct hash_slinger *s, const char *p, const char *q)
{
if (strlen(s->name) != q - p)
return (1);
@@ -350,7 +350,7 @@
/*--------------------------------------------------------------------*/
static void
-cli_check(struct cli *cli)
+cli_check(const struct cli *cli)
{
if (cli->result == CLIS_OK) {
vsb_clear(cli->sb);
Modified: trunk/varnish-cache/include/vrt.h
===================================================================
--- trunk/varnish-cache/include/vrt.h 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/include/vrt.h 2007-09-25 11:11:15 UTC (rev 2041)
@@ -115,9 +115,9 @@
/* Backend related */
-void VRT_init_simple_backend(struct backend **, struct vrt_simple_backend *);
-void VRT_init_round_robin_backend(struct backend **, struct vrt_round_robin_backend *);
-void VRT_init_random_backend(struct backend **, struct vrt_random_backend *);
+void VRT_init_simple_backend(struct backend **, const struct vrt_simple_backend *);
+void VRT_init_round_robin_backend(struct backend **, const struct vrt_round_robin_backend *);
+void VRT_init_random_backend(struct backend **, const struct vrt_random_backend *);
void VRT_fini_backend(struct backend *);
char *VRT_IP_string(struct sess *sp, struct sockaddr *sa);
Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -172,7 +172,7 @@
}
vcc_NextToken(tl);
- Fc(tl, 0, "\nstatic struct vrt_simple_backend sbe_%.*s = {\n",
+ Fc(tl, 0, "\nstatic const struct vrt_simple_backend sbe_%.*s = {\n",
PF(t_be));
Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(t_be));
if (t_port != NULL)
Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -341,7 +341,7 @@
Fc(tl, 0, "\nstatic struct backend\t*backends[%d];\n", tl->nbackend);
- Fc(tl, 0, "\nstruct VCL_conf VCL_conf = {\n");
+ Fc(tl, 0, "\nconst struct VCL_conf VCL_conf = {\n");
Fc(tl, 0, "\t.magic = VCL_CONF_MAGIC,\n");
Fc(tl, 0, "\t.init_func = VGC_Init,\n");
Fc(tl, 0, "\t.fini_func = VGC_Fini,\n");
@@ -558,7 +558,7 @@
vcl_output_lang_h(tl->fh);
Fh(tl, 0, "\n/* ---===### VCC generated below here ###===---*/\n");
- Fh(tl, 0, "\nextern struct VCL_conf VCL_conf;\n");
+ Fh(tl, 0, "\nextern const struct VCL_conf VCL_conf;\n");
/* Register and lex the main source */
VTAILQ_INSERT_TAIL(&tl->sources, sp, list);
Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2007-09-25 11:05:25 UTC (rev 2040)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2007-09-25 11:11:15 UTC (rev 2041)
@@ -493,9 +493,9 @@
vsb_cat(sb, "\n");
vsb_cat(sb, "\n");
vsb_cat(sb, "/* Backend related */\n");
- vsb_cat(sb, "void VRT_init_simple_backend(struct backend **, struct vrt_simple_backend *);\n");
- vsb_cat(sb, "void VRT_init_round_robin_backend(struct backend **, struct vrt_round_robin_backend *);\n");
- vsb_cat(sb, "void VRT_init_random_backend(struct backend **, struct vrt_random_backend *);\n");
+ vsb_cat(sb, "void VRT_init_simple_backend(struct backend **, const struct vrt_simple_backend *);\n");
+ vsb_cat(sb, "void VRT_init_round_robin_backend(struct backend **, const struct vrt_round_robin_backend *);\n");
+ vsb_cat(sb, "void VRT_init_random_backend(struct backend **, const struct vrt_random_backend *);\n");
vsb_cat(sb, "void VRT_fini_backend(struct backend *);\n");
vsb_cat(sb, "\n");
vsb_cat(sb, "char *VRT_IP_string(struct sess *sp, struct sockaddr *sa);\n");
More information about the varnish-commit
mailing list