<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>+1</tt><br>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
OpenSIPS Summit 2018
<a class="moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam">http://www.opensips.org/events/Summit-2018Amsterdam</a>
</pre>
<div class="moz-cite-prefix">On 04/12/2018 02:00 PM, Liviu Chircu
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:f9eeaa7d-be02-5181-241d-bcf29337642a@opensips.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<p><tt>Hi Richard,</tt></p>
<p><tt>IMO, that looks like a slip-up which has been probably
lurking in there since the very beginnings. I suggest we
should fix it to match the expected behavior of
switch/case/default for most (all?) programming languages
which are out there. It would be interesting to hear other
opinions as well before we act, though.<br>
</tt></p>
<p><tt>Cheers,</tt><br>
</p>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com" moz-do-not-send="true">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 09.04.2018 16:38, Richard Revels
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAE-NtRfQwAc_M0zDsOfr86t_f+ZKrPa0omMoLNcYV9XjocxLNQ@mail.gmail.com">
<div dir="ltr">I am unsure of the expected behaviour in the
config switch / case block when the break is not defined
between a defined case and the default case but what I'm
seeing right now is not what I expect. Wanted to get some
input before opening a bug tracker on it.
<div><br>
</div>
<div>--code--</div>
<div>
<div><font face="monospace, monospace" size="1">route[testswitch]</font></div>
<div><font face="monospace, monospace" size="1">{</font></div>
<div><font face="monospace, monospace" size="1">
switch( $avp(testvalue) )</font></div>
<div><font face="monospace, monospace" size="1"> {</font></div>
<div><font face="monospace, monospace" size="1">
case "defined break":</font></div>
<div><font face="monospace, monospace" size="1">
xlog("L_INFO", "log only this line \n");</font></div>
<div><font face="monospace, monospace" size="1">
break;</font></div>
<div><font face="monospace, monospace" size="1"><br>
</font></div>
<div><font face="monospace, monospace" size="1">
case "non defined break":</font></div>
<div><font face="monospace, monospace" size="1">
xlog("L_INFO", "log this line and fall
through to also and then to default \n");</font></div>
<div><font face="monospace, monospace" size="1"><br>
</font></div>
<div><font face="monospace, monospace" size="1">
case "also non defined":</font></div>
<div><font face="monospace, monospace" size="1">
xlog("L_INFO", "log this line and fall
through to default \n");</font></div>
<div><font face="monospace, monospace" size="1"><br>
</font></div>
<div><font face="monospace, monospace" size="1">
default:</font></div>
<div><font face="monospace, monospace" size="1">
xlog("L_ERR", "log default line \n");</font></div>
<div><font face="monospace, monospace" size="1"> }</font></div>
<div><font face="monospace, monospace" size="1">
xlog("L_ERR", "at end of switch block with
$avp(testvalue) \n");</font></div>
<div><font face="monospace, monospace" size="1">}</font></div>
</div>
<div><font face="monospace, monospace" size="1"><br>
</font></div>
<div><font face="monospace, monospace" size="1">...</font></div>
<div><font face="monospace, monospace" size="1"><br>
</font></div>
<div><font face="monospace, monospace" size="1">
<div> $avp(testvalue) := "defined break";</div>
<div> route(testswitch);</div>
<div> $avp(testvalue) := "non defined break";</div>
<div> route(testswitch);</div>
<div> $avp(testvalue) := "also non defined";</div>
<div> route(testswitch);</div>
<div> $avp(testvalue) := "non defined value";</div>
<div> route(testswitch);</div>
<div><br>
</div>
</font></div>
<div>--end code--</div>
<div><br>
</div>
<div>--log--</div>
<div><br>
</div>
<div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092141+00:00
pidflo-01 /sbin/opensips[25651]: log only this line </font></div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092150+00:00
pidflo-01 /sbin/opensips[25651]: at end of switch block
with defined break </font></div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092158+00:00
pidflo-01 /sbin/opensips[25651]: log this line and fall
through to also and then to default </font></div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092161+00:00
pidflo-01 /sbin/opensips[25651]: log this line and fall
through to default </font></div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092164+00:00
pidflo-01 /sbin/opensips[25651]: at end of switch block
with non defined break </font></div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092168+00:00
pidflo-01 /sbin/opensips[25651]: log this line and fall
through to default </font></div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092171+00:00
pidflo-01 /sbin/opensips[25651]: at end of switch block
with also non defined </font></div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092176+00:00
pidflo-01 /sbin/opensips[25651]: log default line </font></div>
<div><font face="monospace, monospace" size="1">2018-04-09T13:13:28.092179+00:00
pidflo-01 /sbin/opensips[25651]: at end of switch block
with non defined value </font></div>
</div>
<div><br>
</div>
<div>--end log--</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><span></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>