From 2ec25ab6df554d9f1a1ca8b99ea9cae0eb4a9f49 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 21 Jul 2006 12:18:01 +0000 Subject: [PATCH] Cleanup git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@538 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache.h | 12 ++---------- varnish-cache/bin/varnishd/cache_expire.c | 1 + varnish-cache/bin/varnishd/cache_fetch.c | 2 -- varnish-cache/bin/varnishd/cache_http.c | 8 ++++---- varnish-cache/bin/varnishd/cache_pool.c | 2 +- varnish-cache/bin/varnishd/cache_session.c | 6 +++--- varnish-cache/bin/varnishd/flint.lnt | 2 ++ 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 23ad992d..eb2394b2 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -303,7 +303,6 @@ void http_Write(struct worker *w, struct http *hp, int resp); void http_CopyReq(int fd, struct http *to, struct http *fm); void http_CopyResp(int fd, struct http *to, struct http *fm); void http_FilterHeader(int fd, struct http *to, struct http *fm, unsigned how); -void http_CopyHeader(int fd, struct http *to, struct http *fm, unsigned n); void http_PrintfHeader(int fd, struct http *to, const char *fmt, ...); int http_IsHdr(struct http_hdr *hh, char *hdr); void http_Setup(struct http *ht, void *space, unsigned len); @@ -316,13 +315,7 @@ int http_Read(struct http *hp, int fd, void *b, unsigned len); void http_RecvHead(struct http *hp, int fd, struct event_base *eb, http_callback_f *func, void *arg); int http_DissectRequest(struct http *sp, int fd); int http_DissectResponse(struct http *sp, int fd); -enum http_build { - Build_Pipe, - Build_Pass, - Build_Fetch, - Build_Reply -}; -void http_BuildSbuf(int fd, enum http_build mode, struct sbuf *sb, struct http *hp); + #define HTTPH(a, b, c, d, e, f, g) extern char b[]; #include "http_headers.h" #undef HTTPH @@ -339,7 +332,7 @@ void WRK_Init(void); void WRK_QueueSession(struct sess *sp); void WRK_Reset(struct worker *w, int *fd); int WRK_Flush(struct worker *w); -void WRK_Write(struct worker *w, const void *ptr, size_t len); +void WRK_Write(struct worker *w, const void *ptr, int len); void WRK_WriteH(struct worker *w, struct http_hdr *hh, const char *suf); /* cache_session.c [SES] */ @@ -347,7 +340,6 @@ void SES_Init(void); struct sess *SES_New(struct sockaddr *addr, unsigned len); void SES_Delete(struct sess *sp); void SES_RefSrcAddr(struct sess *sp); -void SES_RelSrcAddr(struct sess *sp); void SES_ChargeBytes(struct sess *sp, uint64_t bytes); /* cache_shmlog.c */ diff --git a/varnish-cache/bin/varnishd/cache_expire.c b/varnish-cache/bin/varnishd/cache_expire.c index d76b5971..8ec22f49 100644 --- a/varnish-cache/bin/varnishd/cache_expire.c +++ b/varnish-cache/bin/varnishd/cache_expire.c @@ -110,6 +110,7 @@ exp_prefetch(void *arg) (void)arg; sp = SES_New(NULL, 0); + assert(sp != NULL); while (1) { t = time(NULL); AZ(pthread_mutex_lock(&exp_mtx)); diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index 80b0fc19..cb84c1b4 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -209,7 +209,6 @@ FetchBody(struct sess *sp) { int cls; struct vbe_conn *vc; - struct worker *w; char *b; int body = 1; /* XXX */ @@ -217,7 +216,6 @@ FetchBody(struct sess *sp) CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); assert(sp->obj->busy != 0); - w = sp->wrk; vc = sp->vbc; diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index 864650f3..2eaf293f 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -551,8 +551,8 @@ http_CopyResp(int fd, struct http *to, struct http *fm) http_copyh(fd, to, fm, HTTP_HDR_RESPONSE, SLT_Response); } -void -http_CopyHeader(int fd, struct http *to, struct http *fm, unsigned n) +static void +http_copyheader(int fd, struct http *to, struct http *fm, unsigned n) { CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC); @@ -584,7 +584,7 @@ http_FilterHeader(int fd, struct http *to, struct http *fm, unsigned how) continue; #include "http_headers.h" #undef HTTPH - http_CopyHeader(fd, to, fm, u); + http_copyheader(fd, to, fm, u); } } @@ -644,7 +644,7 @@ http_Write(struct worker *w, struct http *hp, int resp) void HTTP_Init(void) { -#define HTTPH(a, b, c, d, e, f, g) b[0] = strlen(b + 1); +#define HTTPH(a, b, c, d, e, f, g) b[0] = (char)strlen(b + 1); #include "http_headers.h" #undef HTTPH } diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 7a0490c2..cd7c3e88 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -75,7 +75,7 @@ WRK_WriteH(struct worker *w, struct http_hdr *hh, const char *suf) } void -WRK_Write(struct worker *w, const void *ptr, size_t len) +WRK_Write(struct worker *w, const void *ptr, int len) { CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); diff --git a/varnish-cache/bin/varnishd/cache_session.c b/varnish-cache/bin/varnishd/cache_session.c index 52943633..f2ade62b 100644 --- a/varnish-cache/bin/varnishd/cache_session.c +++ b/varnish-cache/bin/varnishd/cache_session.c @@ -141,8 +141,8 @@ SES_ChargeBytes(struct sess *sp, uint64_t bytes) sa->addr, (intmax_t)(bytes), now - sa->first); } -void -SES_RelSrcAddr(struct sess *sp) +static void +ses_relsrcaddr(struct sess *sp) { if (sp->srcaddr == NULL) { @@ -188,7 +188,7 @@ SES_Delete(struct sess *sp) CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); VSL_stats->n_sess--; - SES_RelSrcAddr(sp); + ses_relsrcaddr(sp); CHECK_OBJ_NOTNULL(sp->mem, SESSMEM_MAGIC); free(sp->mem); } diff --git a/varnish-cache/bin/varnishd/flint.lnt b/varnish-cache/bin/varnishd/flint.lnt index 45285ead..9ac3c660 100644 --- a/varnish-cache/bin/varnishd/flint.lnt +++ b/varnish-cache/bin/varnishd/flint.lnt @@ -28,6 +28,8 @@ // cache_center.c -efunc(525, CNT_Session) // Negative indentation from line +-efunc(525, http_FilterHeader) // Negative indentation from line +-efunc(539, http_FilterHeader) // Positive indentation from line // cache_vcl.c -efunc(525, vcl_handlingname) // Negative indentation from line -- 2.39.5