<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MQX Software SolutionsのトピックRe: Re: Re: SSI callbacks not working</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322187#M10285</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is a bug in MQX 4.1.0.1 preventing correct invocation of SSI with parameter. To fix it you have to do following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Open file httpsrv_task.c in folder \rtcs\source\apps&lt;/LI&gt;&lt;LI&gt;Go to line 235 (variables definitions).&lt;/LI&gt;&lt;LI&gt;Add following&lt;OL&gt;&lt;LI&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1406014635548339" jivemacro_uid="_1406014635548339"&gt;char*&amp;nbsp; separator;&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Go to line 327 (case HTTPSRV_SSI_CALLBACK).&lt;/LI&gt;&lt;LI&gt;Replace the code for this case with following&lt;/LI&gt;&lt;/OL&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14060145473129324" jivemacro_uid="_14060145473129324" modifiedtitle="true"&gt;
&lt;P&gt;table = (HTTPSRV_FN_LINK_STRUCT*) server-&amp;gt;params.ssi_lnk_tbl;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;/* Set separator to null character temporarily. */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;separator = strchr(msg_ptr-&amp;gt;name, ':');&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;if (separator != NULL)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *separator = '\0';&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;user_function = httpsrv_find_callback(table, &lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;msg_ptr-&amp;gt;name&lt;/SPAN&gt;, &amp;amp;stack_size);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if (separator != NULL)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *separator = ':';&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;
&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;/* Option No.1b - Run User SSI function here. */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;if ((user_function != NULL) &amp;amp;&amp;amp; (stack_size == 0))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; httpsrv_call_ssi((HTTPSRV_SSI_CALLBACK_FN) user_function, msg_ptr);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; httpsrv_ses_flush(msg_ptr-&amp;gt;session);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;break;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should fix the problem you are experiencing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Karel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jul 2014 07:41:49 GMT</pubDate>
    <dc:creator>karelm_</dc:creator>
    <dc:date>2014-07-22T07:41:49Z</dc:date>
    <item>
      <title>SSI callbacks not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322184#M10282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm attempting to test the SSI callback capability of the MQX web server. I had this working under MQX 4.0 but I can't get it to work under 4.1. I'm using the same code and web page I used in 4.0 so I'm really not sure why it doesn't work. &lt;/P&gt;&lt;P&gt;I have created the SSI function, link table, and am passing that into the web server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14056916485418799 jive_text_macro jive_macro_code" jivemacro_uid="_14056916485418799"&gt;
&lt;P&gt;const HTTPSRV_SSI_LINK_STRUCT ssi_tbl[] = {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; { "ssiTest", ssi_test},&lt;/P&gt;
&lt;P&gt;&amp;nbsp; { 0, 0} // DO NOT REMOVE - last item - end of table&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;static _mqx_int ssi_test(HTTPSRV_SSI_PARAM_STRUCT* param) &lt;/P&gt;
&lt;P&gt;{ &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; printf("SSI test func called\n");&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14056917317566823" jivemacro_uid="_14056917317566823"&gt;
&lt;P&gt;HTTPSRV_PARAM_STRUCT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; web_srv_params;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; extern const HTTPSRV_CGI_LINK_STRUCT cgi_tbl[];&lt;/P&gt;
&lt;P&gt;&amp;nbsp; extern const HTTPSRV_SSI_LINK_STRUCT ssi_tbl[];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; _mem_zero(&amp;amp;web_srv_params, sizeof(HTTPSRV_PARAM_STRUCT));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.af = AF_INET; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; web_srv_params.root_dir = "tfs:";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.index_page = "\\WebTest3.shtml";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.max_ses = 1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.use_nagle = FALSE;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.script_stack = 2750;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.server_prio = 7;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.script_prio = 7;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.cgi_lnk_tbl = (HTTPSRV_CGI_LINK_STRUCT*) cgi_tbl;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; web_srv_params.ssi_lnk_tbl = (HTTPSRV_SSI_LINK_STRUCT*) ssi_tbl;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return (HTTPSRV_init(&amp;amp;web_srv_params));&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have my HTML file named as a .shtml file. I have SSI calls in my HTML code in the format specified in the RTCS users guide.&lt;/P&gt;&lt;P&gt;&amp;lt;% ssiTest:parameter %&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I load the web page it just appears to skip right over the SSI and never calls my C code function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any idea why this doesn't work? It's probably something simple I'm missing since it used to work in MQX 4.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 14:03:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322184#M10282</guid>
      <dc:creator>seandema</dc:creator>
      <dc:date>2014-07-18T14:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: SSI callbacks not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322185#M10283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please try to apply patch MQX 4.1.0.1 and let me know if it helped you. You can find it here: &lt;A href="https://community.nxp.com/docs/DOC-101315"&gt;MQX™ RTOS 4.1.0.1 Patch Release&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best reagards,&lt;/P&gt;&lt;P&gt;Karel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 08:54:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322185#M10283</guid>
      <dc:creator>karelm_</dc:creator>
      <dc:date>2014-07-21T08:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Re: SSI callbacks not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322186#M10284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried installing the patch but it still doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I set a break point in httpsrv_supp.c httpsrv_sendextstr() I can see it hitting the lines:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14059662852063980" jivemacro_uid="_14059662852063980"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _msgq_send(msg_ptr);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Wait until SSI is processed. */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The check for shtml in httpsrv_sendfile() is also true when I step through&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14059663717077526 jive_macro_code" jivemacro_uid="_14059663717077526"&gt;
&lt;P&gt;if ((0 == strcasecmp(ext, ".shtml")) || (0 == strcasecmp(ext, ".shtm")))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though I never see httpsrv_call_ssi() being called. I'm not real familiar with this area of MQX code but it seems like that is something that should be called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I have noticed that if I remove the ":paramater" part of the &amp;lt;%function_name:parameter%&amp;gt; and just put &amp;lt;%ssiTest%&amp;gt; in my shtml file that it will call my SSI function. It seems to work normally in this case but I lose that ability to pass in a parameter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is anything else I should try please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 18:56:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322186#M10284</guid>
      <dc:creator>seandema</dc:creator>
      <dc:date>2014-07-21T18:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: SSI callbacks not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322187#M10285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is a bug in MQX 4.1.0.1 preventing correct invocation of SSI with parameter. To fix it you have to do following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Open file httpsrv_task.c in folder \rtcs\source\apps&lt;/LI&gt;&lt;LI&gt;Go to line 235 (variables definitions).&lt;/LI&gt;&lt;LI&gt;Add following&lt;OL&gt;&lt;LI&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1406014635548339" jivemacro_uid="_1406014635548339"&gt;char*&amp;nbsp; separator;&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Go to line 327 (case HTTPSRV_SSI_CALLBACK).&lt;/LI&gt;&lt;LI&gt;Replace the code for this case with following&lt;/LI&gt;&lt;/OL&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14060145473129324" jivemacro_uid="_14060145473129324" modifiedtitle="true"&gt;
&lt;P&gt;table = (HTTPSRV_FN_LINK_STRUCT*) server-&amp;gt;params.ssi_lnk_tbl;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;/* Set separator to null character temporarily. */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;separator = strchr(msg_ptr-&amp;gt;name, ':');&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;if (separator != NULL)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *separator = '\0';&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;user_function = httpsrv_find_callback(table, &lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;msg_ptr-&amp;gt;name&lt;/SPAN&gt;, &amp;amp;stack_size);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if (separator != NULL)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *separator = ':';&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;
&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;/* Option No.1b - Run User SSI function here. */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;if ((user_function != NULL) &amp;amp;&amp;amp; (stack_size == 0))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; httpsrv_call_ssi((HTTPSRV_SSI_CALLBACK_FN) user_function, msg_ptr);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; httpsrv_ses_flush(msg_ptr-&amp;gt;session);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;break;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should fix the problem you are experiencing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Karel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 07:41:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322187#M10285</guid>
      <dc:creator>karelm_</dc:creator>
      <dc:date>2014-07-22T07:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: SSI callbacks not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322188#M10286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That fixed it. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 14:27:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SSI-callbacks-not-working/m-p/322188#M10286</guid>
      <dc:creator>seandema</dc:creator>
      <dc:date>2014-07-22T14:27:15Z</dc:date>
    </item>
  </channel>
</rss>

