Permalink
Browse files

Change the code to work with trunk Varnish.

  • Loading branch information...
mbgrydeland committed Feb 29, 2012
1 parent b7de64f commit 43ff4aeaf742c49ac06ecf8a21039ece85da41d8
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/vmod_example.c
View
@@ -1,7 +1,8 @@
#include <stdlib.h>
+#include <stdio.h>
#include "vrt.h"
-#include "bin/varnishd/cache.h"
+#include "cache/cache.h"
#include "vcc_if.h"
@@ -17,16 +18,16 @@ vmod_hello(struct sess *sp, const char *name)
char *p;
unsigned u, v;
- u = WS_Reserve(sp->wrk->ws, 0); /* Reserve some work space */
- p = sp->wrk->ws->f; /* Front of workspace area */
+ u = WS_Reserve(sp->req->ws, 0); /* Reserve some work space */
+ p = sp->req->ws->f; /* Front of workspace area */
v = snprintf(p, u, "Hello, %s", name);
v++;
if (v > u) {
/* No space, reset and leave */
- WS_Release(sp->wrk->ws, 0);
+ WS_Release(sp->req->ws, 0);
return (NULL);
}
/* Update work space with what we've used */
- WS_Release(sp->wrk->ws, v);
+ WS_Release(sp->req->ws, v);
return (p);
}

0 comments on commit 43ff4ae

Please sign in to comment.