r135 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Apr 6 12:00:45 CEST 2006


Author: phk
Date: 2006-04-06 12:00:45 +0200 (Thu, 06 Apr 2006)
New Revision: 135

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_backend.c
Log:
Add VBE_RecycleFd() function to recycle backend connections



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2006-04-06 09:59:30 UTC (rev 134)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2006-04-06 10:00:45 UTC (rev 135)
@@ -25,7 +25,9 @@
 int VBE_GetFd(struct backend *bp, void **ptr);
 void VBE_Pass(struct sess *sp);
 void VBE_ClosedFd(void *ptr);
+void VBE_RecycleFd(void *ptr);
 
+
 /* cache_httpd.c */
 void HttpdAnalyze(struct sess *sp, int rr);
 void HttpdGetHead(struct sess *sp, struct event_base *eb, sesscb_f *func);

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2006-04-06 09:59:30 UTC (rev 134)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2006-04-06 10:00:45 UTC (rev 135)
@@ -128,6 +128,8 @@
 	return (vc->fd);
 }
 
+/*--------------------------------------------------------------------*/
+
 void
 VBE_ClosedFd(void *ptr)
 {
@@ -140,7 +142,20 @@
 	free(vc);
 }
 
+/*--------------------------------------------------------------------*/
 
+void
+VBE_RecycleFd(void *ptr)
+{
+	struct vbe_conn *vc;
+
+	vc = ptr;
+	AZ(pthread_mutex_lock(&vbemtx));
+	TAILQ_REMOVE(&vc->vbe->bconn, vc, list);
+	TAILQ_INSERT_HEAD(&vc->vbe->fconn, vc, list);
+	AZ(pthread_mutex_unlock(&vbemtx));
+}
+
 /*--------------------------------------------------------------------*/
 
 void


Property changes on: trunk/varnish-cache/bin/varnishd/cache_backend.c
___________________________________________________________________
Name: svn:keywords
   + Id




More information about the varnish-commit mailing list