Mailing List Archive

r1830 - in trunk/varnish-cache: bin/varnishd include lib/libvcl
Author: phk
Date: 2007-08-10 12:28:08 +0200 (Fri, 10 Aug 2007)
New Revision: 1830

Modified:
trunk/varnish-cache/bin/varnishd/cache_vrt.c
trunk/varnish-cache/include/vrt.h
trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
trunk/varnish-cache/lib/libvcl/vcc_parse.c
Log:
Don't call functions outside the VRT namespace, even if this means
that we have to wrap strcmp().



Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2007-08-10 09:51:16 UTC (rev 1829)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2007-08-10 10:28:08 UTC (rev 1830)
@@ -502,6 +502,17 @@
}

/*--------------------------------------------------------------------
+ * Simple stuff
+ */
+
+int
+VRT_strcmp(const char *s1, const char *s2)
+{
+ return (strcmp(s1, s2));
+}
+
+
+/*--------------------------------------------------------------------
* Backend stuff, should probably move to its own file eventually
*/
void

Modified: trunk/varnish-cache/include/vrt.h
===================================================================
--- trunk/varnish-cache/include/vrt.h 2007-08-10 09:51:16 UTC (rev 1829)
+++ trunk/varnish-cache/include/vrt.h 2007-08-10 10:28:08 UTC (rev 1830)
@@ -88,6 +88,10 @@
void VRT_SetHdr(struct sess *, enum gethdr_e where, const char *, const char *, ...);
void VRT_handling(struct sess *sp, unsigned hand);

+/* Simple stuff */
+int VRT_strcmp(const char *s1, const char *s2);
+
+
/* Backend related */
void VRT_init_simple_backend(struct backend **, struct vrt_simple_backend *);
void VRT_fini_backend(struct backend *);

Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2007-08-10 09:51:16 UTC (rev 1829)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2007-08-10 10:28:08 UTC (rev 1830)
@@ -446,6 +446,10 @@
vsb_cat(sb, "void VRT_SetHdr(struct sess *, enum gethdr_e where, const char *, const char *, ...);\n");
vsb_cat(sb, "void VRT_handling(struct sess *sp, unsigned hand);\n");
vsb_cat(sb, "\n");
+ vsb_cat(sb, "/* Simple stuff */\n");
+ vsb_cat(sb, "int VRT_strcmp(const char *s1, const char *s2);\n");
+ vsb_cat(sb, "\n");
+ vsb_cat(sb, "\n");
vsb_cat(sb, "/* Backend related */\n");
vsb_cat(sb, "void VRT_init_simple_backend(struct backend **, struct vrt_simple_backend *);\n");
vsb_cat(sb, "void VRT_fini_backend(struct backend *);\n");

Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2007-08-10 09:51:16 UTC (rev 1829)
+++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2007-08-10 10:28:08 UTC (rev 1830)
@@ -232,7 +232,7 @@
break;
case T_EQ:
case T_NEQ:
- Fb(tl, 1, "%sstrcmp(%s, ",
+ Fb(tl, 1, "%sVRT_strcmp(%s, ",
tl->t->tok == T_EQ ? "!" : "", vp->rname);
vcc_NextToken(tl);
ExpectErr(tl, CSTR);
r1830 - in trunk/varnish-cache: bin/varnishd include lib/libvcl [ In reply to ]
phk at projects.linpro.no writes:
> Log:
> Don't call functions outside the VRT namespace, even if this means
> that we have to wrap strcmp().

I believe there's a strndup() call in there somewhere as well?

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no
r1830 - in trunk/varnish-cache: bin/varnishd include lib/libvcl [ In reply to ]
In message <ujrir7nbrk1.fsf at false.linpro.no>, =?iso-8859-1?Q?Dag-Erling_Sm=F8rg
rav?= writes:
>phk at projects.linpro.no writes:
>> Log:
>> Don't call functions outside the VRT namespace, even if this means
>> that we have to wrap strcmp().
>
>I believe there's a strndup() call in there somewhere as well?

Hopefully not in the compiled code ?

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
r1830 - in trunk/varnish-cache: bin/varnishd include lib/libvcl [ In reply to ]
"Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
> Dag-Erling Sm?rgrav <des at linpro.no> writes:
> > phk at projects.linpro.no writes:
> > > Log:
> > > Don't call functions outside the VRT namespace, even if this means
> > > that we have to wrap strcmp().
> >I believe there's a strndup() call in there somewhere as well?
>
> Hopefully not in the compiled code ?

Never mind, the strndup() issue (#118) was not related to VCL.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no
r1830 - in trunk/varnish-cache: bin/varnishd include lib/libvcl [ In reply to ]
phk at projects.linpro.no wrote:
>
> Modified:
> trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c

Did you modify vcc_gen_fixed_token.tcl for this, but not commit it?

--
cecilie.fritzvold at linpro.no
Linpro AS
http://www.linpro.no