r253 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Wed Jun 28 18:20:14 CEST 2006
Author: phk
Date: 2006-06-28 18:20:14 +0200 (Wed, 28 Jun 2006)
New Revision: 253
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_fetch.c
trunk/varnish-cache/bin/varnishd/cache_http.c
trunk/varnish-cache/bin/varnishd/cache_pass.c
trunk/varnish-cache/bin/varnishd/cache_pipe.c
Log:
Pass fd to shmemlog
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2006-06-28 16:19:21 UTC (rev 252)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2006-06-28 16:20:14 UTC (rev 253)
@@ -174,7 +174,7 @@
int http_GetURL(struct http *hp, char **b);
void http_RecvHead(struct http *hp, int fd, struct event_base *eb, http_callback_f *func, void *arg);
void http_Dissect(struct http *sp, int fd, int rr);
-void http_BuildSbuf(int resp, struct sbuf *sb, struct http *hp);
+void http_BuildSbuf(int fd, int resp, struct sbuf *sb, struct http *hp);
/* cache_main.c */
extern pthread_mutex_t sessmtx;
Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2006-06-28 16:19:21 UTC (rev 252)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2006-06-28 16:20:14 UTC (rev 253)
@@ -243,7 +243,7 @@
VSL(SLT_Backend, sp->fd, "%d %s", fd, sp->backend->vcl_name);
hp = http_New();
- http_BuildSbuf(1, w->sb, sp->http);
+ http_BuildSbuf(fd, 1, w->sb, sp->http);
i = write(fd, sbuf_data(w->sb), sbuf_len(w->sb));
assert(i == sbuf_len(w->sb));
time(&t_req);
@@ -262,7 +262,7 @@
switch (http_GetStatus(hp)) {
case 200:
case 301:
- http_BuildSbuf(3, w->sb, hp);
+ http_BuildSbuf(sp->fd, 3, w->sb, hp);
/* XXX: fill in object from headers */
sp->obj->valid = 1;
sp->obj->cacheable = 1;
@@ -270,7 +270,7 @@
body = 1;
break;
case 304:
- http_BuildSbuf(3, w->sb, hp);
+ http_BuildSbuf(sp->fd, 3, w->sb, hp);
/* XXX: fill in object from headers */
sp->obj->valid = 1;
sp->obj->cacheable = 1;
@@ -305,7 +305,7 @@
} else
cls = 0;
- http_BuildSbuf(2, w->sb, hp);
+ http_BuildSbuf(sp->fd, 2, w->sb, hp);
vca_write_obj(sp, w->sb);
Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c 2006-06-28 16:19:21 UTC (rev 252)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c 2006-06-28 16:20:14 UTC (rev 253)
@@ -391,7 +391,7 @@
/*--------------------------------------------------------------------*/
void
-http_BuildSbuf(int resp, struct sbuf *sb, struct http *hp)
+http_BuildSbuf(int fd, int resp, struct sbuf *sb, struct http *hp)
{
unsigned u;
@@ -419,7 +419,7 @@
if (http_supress(hp->hdr[u], resp))
continue;
if (1)
- VSL(SLT_Debug, 0, "Build %s", hp->hdr[u]);
+ VSL(SLT_BldHdr, fd, "%s", hp->hdr[u]);
sbuf_cat(sb, hp->hdr[u]);
sbuf_cat(sb, "\r\n");
}
Modified: trunk/varnish-cache/bin/varnishd/cache_pass.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pass.c 2006-06-28 16:19:21 UTC (rev 252)
+++ trunk/varnish-cache/bin/varnishd/cache_pass.c 2006-06-28 16:20:14 UTC (rev 253)
@@ -160,7 +160,7 @@
fd = VBE_GetFd(sp->backend, &fd_token);
assert(fd != -1);
- http_BuildSbuf(1, w->sb, sp->http);
+ http_BuildSbuf(fd, 1, w->sb, sp->http);
i = write(fd, sbuf_data(w->sb), sbuf_len(w->sb));
assert(i == sbuf_len(w->sb));
@@ -175,7 +175,7 @@
event_base_loop(w->eb, 0);
http_Dissect(hp, fd, 2);
- http_BuildSbuf(2, w->sb, hp);
+ http_BuildSbuf(sp->fd, 2, w->sb, hp);
vca_write(sp, sbuf_data(w->sb), sbuf_len(w->sb));
if (http_GetHdr(hp, "Content-Length", &b))
Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pipe.c 2006-06-28 16:19:21 UTC (rev 252)
+++ trunk/varnish-cache/bin/varnishd/cache_pipe.c 2006-06-28 16:20:14 UTC (rev 253)
@@ -51,7 +51,7 @@
fd = VBE_GetFd(sp->backend, &fd_token);
assert(fd != -1);
- http_BuildSbuf(0, w->sb, sp->http); /* XXX: 0 ?? */
+ http_BuildSbuf(fd, 0, w->sb, sp->http); /* XXX: 0 ?? */
i = write(fd, sbuf_data(w->sb), sbuf_len(w->sb));
assert(i == sbuf_len(w->sb));
assert(__LINE__ == 0);
More information about the varnish-commit
mailing list