[sr-dev] return() not terminating switch statement

Juha Heinanen jh at tutpro.com
Tue Sep 28 17:12:06 CEST 2010


i noticed that in sr master version, return is not terminating switch
statement.

i have

route [foo] {
        switch ($var(test)) {
        case "e1":
            xlog("L_INFO", "We are at e1\n");
            return(1);
        case "lo":
            xlog("L_INFO", "... and at lo\n");
            return(2);
        default:
            xlog("L_INFO", "... and at default\n");
        };
	return(-1);
}

and when the switch statement is executed, i get to syslog

Sep 28 18:09:12 sip /usr/sbin/sip-proxy[3802]: INFO: We are at e1
Sep 28 18:09:12 sip /usr/sbin/sip-proxy[3802]: INFO: ... and at default

why is that?  is it a bug or strange "feature".

-- juha



More information about the sr-dev mailing list