Commit e2cc1f86 authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Merged revisions 1727-1729 via svnmerge from

svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache

........
  r1727 | des | 2007-07-20 10:38:22 +0200 (Fri, 20 Jul 2007) | 2 lines
  
  Let the LRU code worry about this.
........
  r1728 | des | 2007-07-20 10:39:45 +0200 (Fri, 20 Jul 2007) | 2 lines
  
  Paranoia.
........
  r1729 | des | 2007-07-20 10:40:33 +0200 (Fri, 20 Jul 2007) | 2 lines
  
  Count backend requests.
........


git-svn-id: http://www.varnish-cache.org/svn/branches/1.1@1736 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 630957a1
......@@ -82,8 +82,7 @@ void
EXP_Terminate(struct object *o)
{
LOCK(&exp_mtx);
if (o->lru_stamp)
LRU_Remove(o);
LRU_Remove(o);
if (o->heap_idx)
binheap_delete(exp_heap, o->heap_idx);
if (o->deathrow.tqe_next) {
......
......@@ -286,6 +286,9 @@ Fetch(struct sess *sp)
return (1);
}
/* XXX is this the right place? */
VSL_stats->backend_req++;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
......
......@@ -46,7 +46,7 @@ static void
rdf(struct pollfd *fds, int idx)
{
int i, j;
char buf[BUFSIZ];
char buf[BUFSIZ], *p;
i = read(fds[idx].fd, buf, sizeof buf);
if (i <= 0 || fds[1-idx].events == 0) {
......@@ -55,14 +55,17 @@ rdf(struct pollfd *fds, int idx)
shutdown(fds[idx].fd, SHUT_RD);
shutdown(fds[1-idx].fd, SHUT_WR);
fds[idx].events = 0;
} else {
j = write(fds[1-idx].fd, buf, i);
if (i != j) {
return;
}
for (p = buf; i > 0; i -= j, p += j) {
j = write(fds[1-idx].fd, p, i);
if (j < 0) {
VSL(SLT_Debug, fds[idx].fd, "Pipe Shut write(write)");
VSL(SLT_Debug, fds[1-idx].fd, "Pipe Shut read(write)");
shutdown(fds[idx].fd, SHUT_WR);
shutdown(fds[1-idx].fd, SHUT_RD);
fds[1-idx].events = 0;
return;
}
}
}
......
......@@ -89,3 +89,5 @@ MAC_STAT(sm_nreq, uint64_t, 'a', "allocator requests")
MAC_STAT(sm_nobj, uint64_t, 'i', "outstanding allocations")
MAC_STAT(sm_balloc, uint64_t, 'i', "bytes allocated")
MAC_STAT(sm_bfree, uint64_t, 'i', "bytes free")
MAC_STAT(backend_req, uint64_t, 'a', "Backend requests made")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment