]> err.no Git - varnish/commitdiff
Experimentally pull in VCL program
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 27 Mar 2006 11:22:29 +0000 (11:22 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 27 Mar 2006 11:22:29 +0000 (11:22 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@76 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/Makefile.am
varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishd/varnishd.c

index ef009320f79c29736f06d5b49af1bd3636fe1dd1..34828a61c015de83b81a7a50033acf0c7987b741 100644 (file)
@@ -14,8 +14,11 @@ varnishd_SOURCES = \
        tcp.c \
        varnishd.c
 
+varnishd_LDFLAGS = -export-dynamic 
+
 varnishd_LDADD = \
        $(top_builddir)/lib/libvarnish/libvarnish.la \
        $(top_builddir)/lib/libsbuf/libsbuf.la \
+       $(top_builddir)/lib/libvcl/libvcl.la \
        $(top_builddir)/contrib/libevent/libevent.la \
        -lpthread
index 7df59c413ebbd2589f6e472f26b0c7ae8ac95356..ae46f4f6163e066e6893dab25188bd2c05492ed7 100644 (file)
@@ -37,7 +37,6 @@ http_read_f(int fd, short event, void *arg)
        const char *p;
        int i;
 
-       printf("%s(%d, %d, ...)\n", __func__, fd, event);
        assert(VCA_RXBUFSIZE - sp->rcv_len > 0);
        i = read(fd, sp->rcv + sp->rcv_len, VCA_RXBUFSIZE - sp->rcv_len);
        if (i <= 0) {
@@ -67,6 +66,9 @@ http_read_f(int fd, short event, void *arg)
        sp->hdr_e = p;
        event_del(sp->rd_e);
        HttpdAnalyze(sp);
+
+       /* XXX: for now, pass everything */
+       sp->handling = HND_Pass;
 }
 
 static void
index 3957a60788bceeaefec0527ec7f4d7c8b0507381..7e7a073474e0212e0de0cff49e6cd4d09771a7ff 100644 (file)
@@ -23,6 +23,7 @@
 #include <cli.h>
 #include <cli_priv.h>
 #include <libvarnish.h>
+#include <libvcl.h>
 
 #include "mgt.h"
 #include "heritage.h"
@@ -204,6 +205,14 @@ init_vsl(const char *fn, unsigned size)
 
 /* for development purposes */
 #include <printf.h>
+#include <err.h>
+
+#include <dlfcn.h>
+
+void
+VCL_count(unsigned u)
+{
+}
 
 int
 main(int argc, char *argv[])
@@ -213,6 +222,30 @@ main(int argc, char *argv[])
        unsigned dflag = 1;     /* XXX: debug=on for now */
 
        register_printf_render_std((const unsigned char *)"HVQ");
+       {
+       struct sbuf *sb;
+
+       VCL_InitCompile();
+       sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+       assert(sb != NULL);
+       VCL_Compile(sb,
+           "backend default { set backend.ip = 10.0.0.1; } ",
+           NULL);
+       sbuf_finish(sb);
+       fprintf(stderr, "Result: %s\n", sbuf_data(sb));
+
+       {
+       void *dlhandle;
+
+       dlhandle = dlopen("/tmp/_.so.1",
+           RTLD_NOW | RTLD_LOCAL );
+       if (dlhandle == NULL)
+               err(1, "dlopen %s", dlerror());
+       
+       }
+       exit (0);
+       }
 
        while ((o = getopt(argc, argv, "dp:")) != -1)
                switch (o) {