r380 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sat Jul 8 21:54:10 CEST 2006


Author: phk
Date: 2006-07-08 21:54:10 +0200 (Sat, 08 Jul 2006)
New Revision: 380

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
Move struct http into cache.h

The original reasoning for having it private to cache_http.c was
to avoid pollution with event.h related structures but since that
pollution is happening other ways anyway, the cost is too high.

Include pthread.h, sys/time.h, and event.h from cache.h



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2006-07-08 19:46:11 UTC (rev 379)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2006-07-08 19:54:10 UTC (rev 380)
@@ -2,7 +2,10 @@
  * $Id$
  */
 
+#include <pthread.h>
+#include <sys/time.h>
 #include <queue.h>
+#include <event.h>
 
 #include "vcl_returns.h"
 
@@ -15,7 +18,36 @@
 struct object;
 struct objhead;
 
-#ifdef EV_TIMEOUT
+/*--------------------------------------------------------------------
+ * HTTP Request/Response/Header handling structure.
+ * RSN: struct worker and struct session will have one of these embedded.
+ */
+
+typedef void http_callback_f(void *, int bad);
+
+struct http {
+	struct event		ev;
+	http_callback_f		*callback;
+	void			*arg;
+
+	char			*s;		/* start of buffer */
+	char			*e;		/* end of buffer */
+	char			*v;		/* valid bytes */
+	char			*t;		/* start of trailing data */
+
+
+	char			*req;
+	char			*url;
+	char			*proto;
+	char			*status;
+	char			*response;
+	
+	char			**hdr;
+	unsigned		nhdr;
+};
+
+/*--------------------------------------------------------------------*/
+
 struct worker {
 	struct event_base	*eb;
 	struct event		e1, e2;
@@ -23,9 +55,6 @@
 	struct objhead		*nobjhead;
 	struct object		*nobj;
 };
-#else
-struct worker;
-#endif
 
 #include "hash_slinger.h"
 
@@ -169,8 +198,6 @@
 void HSH_Init(void);
 
 /* cache_http.c */
-typedef void http_callback_f(void *, int bad);
-struct http;
 struct http *http_New(void);
 void http_Delete(struct http *hp);
 int http_GetHdr(struct http *hp, const char *hdr, char **ptr);
@@ -187,7 +214,7 @@
 	Build_Pipe,
 	Build_Pass,
 	Build_Fetch,
-	Build_Reply,
+	Build_Reply
 };
 void http_BuildSbuf(int fd, enum http_build mode, struct sbuf *sb, struct http *hp);
 

Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2006-07-08 19:46:11 UTC (rev 379)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2006-07-08 19:54:10 UTC (rev 380)
@@ -23,29 +23,6 @@
 
 /*--------------------------------------------------------------------*/
 
-struct http {
-	struct event		ev;
-	http_callback_f		*callback;
-	void			*arg;
-
-	char			*s;		/* start of buffer */
-	char			*e;		/* end of buffer */
-	char			*v;		/* valid bytes */
-	char			*t;		/* start of trailing data */
-
-
-	char			*req;
-	char			*url;
-	char			*proto;
-	char			*status;
-	char			*response;
-	
-	char			**hdr;
-	unsigned		nhdr;
-};
-
-/*--------------------------------------------------------------------*/
-
 struct http *
 http_New(void)
 {




More information about the varnish-commit mailing list