AN3928 bug, lwip http server with dynamic data

cancel
Showing results for 
Search instead for 
Did you mean: 

AN3928 bug, lwip http server with dynamic data

159 Views
Contributor I

The source code (AN3928SW.zip) of AN3928 ("Web Server Using the MCF51CN Family and FreeRTOS") has a bug.

The problem is in function HTTP_SendDynamicData in http_server.c

If a WEB page with dynamic content inside (.SHTML or .FSL extension) is stored in SD card then the SSI parsing can produce wrong results.

Data from a file in SD is readed by blocks, the function HTTP_SendDynamicData searches the string "<!--#echo var=\"" in one block at a time, but if the block doesn't contain that string ENTIRELY this search will fail and the block is sent via ethernet without its dynamic variable.

Example:

BLOCK 0 ends with "<!--#ech"

BLOCK 1 starts with "o var=\"CHANNEL0"  etc

In function HTTP_SendDynamicData, row #554 in http_server.c, when it searches in BLOCK 0:

"if(( index_a = (uint8 *)strstr(dynamic_start,SSI_START) ) != NULL)"

Variable "index_a" will be NULL, so the SSI parsing never happens.

So it's not safe to have SSI web pages stored in SD card.

No problem if they are statically stored as const array in static_web_pages.c.

0 Kudos
3 Replies

8 Views
NXP TechSupport
NXP TechSupport

Hi,

I would recommend customer to check here about latest FreeRTOS uIP Embedded web server example for MCF51CN128 tower board.

Wish it helps.


Have a great day,
Mike

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

8 Views
Contributor I

?

That has nothing to do with the problem I found.

I'm talking about a bug in a specific Freescale application note. Period.

0 Kudos

8 Views
NXP TechSupport
NXP TechSupport

Hi,

For the AN3928 author Paolo had left NXP( legacy Freescale) for many year, nobody maintain this application note so far.

Sorry for that may bring any inconvenience to you.


Have a great day,
Mike

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos