[Varnish] #655: Mismatching /* ... */ might cause confusion

Varnish varnish-bugs at projects.linpro.no
Sat Feb 27 13:01:04 CET 2010


#655: Mismatching /* ... */ might cause confusion
-------------------------+--------------------------------------------------
 Reporter:  zviratko     |       Owner:  phk  
     Type:  enhancement  |      Status:  new  
 Priority:  low          |   Milestone:       
Component:  varnishd     |     Version:  trunk
 Severity:  minor        |    Keywords:       
-------------------------+--------------------------------------------------
 They certainly did for me

 when the following is compiled, it results in a seemingly incorrect C
 code:

 backend default {
         .host = "localhost";
         .port = "80";
         }

 sub vcl_recv {
         if (req.request != "GET" &&
                 req.request != "HEAD" &&
                 req.request != "PUT" &&
                 req.request != "POST" &&
                 req.request != "TRACE" &&
                 req.request != "OPTIONS" &&
                 req.request != "DELETE" &&
                 req.request != "PURGE") {
                 /* Non-RFC2616 or CONNECT which is weird. */
                 pipe;
         }

         if (req.request != "GET" && req.request != "HEAD" && req.request
 != "PURGE" && req.request != "POST" ) {
                 /* We only deal with GET and HEAD by default */
                 /* Zviratko - and with zero-sized POST as well, 3v1l h4ck
 *
                 pass;
         }

         if ( req.request == "POST" ) {
                         /* Zviratko - zero-sized POST is an AJAX hack,
 fsck it! */
                         set req.http.X-Request = "GETTED";
                         pass;
                 }
                 else if ( req.request == "POST" ) {
                         set req.http.X-Request = "POSTED";
                         pass;
         }

 }


 while in fact there is / missing:
                 /* Zviratko - and with zero-sized POST as well, 3v1l h4ck
 *

 and so the comment is matched up to:

                         /* Zviratko - zero-sized POST is an AJAX hack,
 fsck it! */

 maybe you might spit a warning when /* and */ numbers mismatch?

-- 
Ticket URL: <http://varnish-cache.org/ticket/655>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list