r149 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Tue Apr 25 09:04:43 CEST 2006
Author: phk
Date: 2006-04-25 09:04:43 +0200 (Tue, 25 Apr 2006)
New Revision: 149
Modified:
trunk/varnish-cache/bin/varnishd/cache_backend.c
trunk/varnish-cache/bin/varnishd/cache_fetch.c
Log:
Track backend connections in shmem log
Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c 2006-04-25 06:52:26 UTC (rev 148)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2006-04-25 07:04:43 UTC (rev 149)
@@ -16,7 +16,9 @@
#include <unistd.h>
#include "libvarnish.h"
+#include "shmlog.h"
#include "vcl_lang.h"
+#include "cache.h"
/*
* The internal backend structure for managing connection pools per
@@ -82,6 +84,7 @@
} while ((res0 = res0->ai_next) != NULL);
freeaddrinfo(res);
vc->fd = s;
+ VSL(SLT_BackendOpen, vc->fd, "");
return;
}
@@ -136,6 +139,8 @@
struct vbe_conn *vc;
vc = ptr;
+ VSL(SLT_BackendClose, vc->fd, "");
+ close(vc->fd);
AZ(pthread_mutex_lock(&vbemtx));
TAILQ_REMOVE(&vc->vbe->bconn, vc, list);
AZ(pthread_mutex_unlock(&vbemtx));
@@ -150,6 +155,7 @@
struct vbe_conn *vc;
vc = ptr;
+ VSL(SLT_BackendReuse, vc->fd, "");
AZ(pthread_mutex_lock(&vbemtx));
TAILQ_REMOVE(&vc->vbe->bconn, vc, list);
TAILQ_INSERT_HEAD(&vc->vbe->fconn, vc, list);
Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2006-04-25 06:52:26 UTC (rev 148)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2006-04-25 07:04:43 UTC (rev 149)
@@ -106,7 +106,6 @@
if (http_GetHdr(sp->http, "Connection", &b) &&
!strcasecmp(b, "close")) {
- close(fd);
VBE_ClosedFd(fd_token);
} else {
VBE_RecycleFd(fd_token);
More information about the varnish-commit
mailing list