<HTML>
<HEAD>
<TITLE>Re: [Freeswitch-dev] Unreachable code in mod_spidermonkey.c (event_chat_execute)</TITLE>
</HEAD>
<BODY>
<FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>Jira Please<BR>
<BR>
<BR>
On 10/1/12 11:07 AM, "Niels Thomsen" <<a href="niels.thomsen@fentechnology.co.uk">niels.thomsen@fentechnology.co.uk</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><SPAN STYLE='font-size:11pt'><FONT FACE="Calibri, Verdana, Helvetica, Arial">There’s a bit of unreachable code in mod_spidermonkey which means that the event_chat_execute function becomes a no-op.<BR>
<BR>
This may be intentional, of course, but it doesn’t look like it is…<BR>
<BR>
static JSBool event_chat_execute(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)<BR>
{<BR>
struct event_obj *eo = JS_GetPrivate(cx, obj);<BR>
<BR>
if (eo) {<BR>
if (argc > 0) {<BR>
char *app = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));<BR>
char *arg = NULL;<BR>
<BR>
if (argc > 1) {<BR>
arg = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));<BR>
}<BR>
<BR>
goto end;<BR>
<BR>
//-- this code is never executed <BR>
switch_core_execute_chat_app(eo->event, app, arg);<BR>
<BR>
*rval = BOOLEAN_TO_JSVAL(JS_TRUE);<BR>
return JS_TRUE;<BR>
}<BR>
}<BR>
<BR>
end:<BR>
<BR>
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);<BR>
return JS_FALSE;<BR>
}<BR>
</FONT></SPAN><FONT SIZE="1"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:9pt'> <BR>
</SPAN></FONT></FONT><FONT FACE="Consolas, Courier New, Courier"><FONT SIZE="2"><SPAN STYLE='font-size:10pt'>- Niels<BR>
</SPAN></FONT></FONT><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'><BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_________________________________________________________________________<BR>
Professional FreeSWITCH Consulting Services:<BR>
<a href="consulting@freeswitch.org">consulting@freeswitch.org</a><BR>
<a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><BR>
<BR>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
<a href="http://www.cudatel.com">http://www.cudatel.com</a><BR>
<BR>
Official FreeSWITCH Sites<BR>
<a href="http://www.freeswitch.org">http://www.freeswitch.org</a><BR>
<a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a><BR>
<a href="http://www.cluecon.com">http://www.cluecon.com</a><BR>
<BR>
FreeSWITCH-dev mailing list<BR>
<a href="FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><BR>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><BR>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><BR>
<a href="http://www.freeswitch.org">http://www.freeswitch.org</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
</SPAN></FONT></FONT><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>-- <BR>
Ken<BR>
<FONT COLOR="#0000FF"><U><a href="http://www.FreeSWITCH.org">http://www.FreeSWITCH.org</a><BR>
<a href="http://www.ClueCon.com">http://www.ClueCon.com</a><BR>
<a href="http://www.OSTAG.org">http://www.OSTAG.org</a><BR>
</U></FONT>irc.freenode.net #freeswitch<BR>
</SPAN></FONT>
</BODY>
</HTML>