Dynamic web content: Function calls out of nowhere?

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Dynamic web content: Function calls out of nowhere?

Post by DemoniacMilk »

On observing some weird behaviour of the website running on my xcore, I added some debug prints in the website functions that are used to add dynamic content to the webpage. I realized that functions were called twice, although the website files only name them once.

Function calls within a web file are initiated by a char \255 followed by the ID of the function to be called. After analyzing the char-arrays representing the web files in web_files.c, I can assure that functions are not called multiple times within a file (except if intended).

however, it seems the functions having the 9 lowest function IDs are ALWAYS called. (Added a print to web_server_dyn_express(), the function that links function IDs and functions).
Opening a page printing an error log looks like this:

Code: Select all

web function call #0    <-- process post
web function call #1    <-- insert header
web function call #2    <-- insert menu
web function call #3    <-- close header
web function call #4    <-- print user feedback
feedback
web function call #5    <-- print device name
web function call #6    <-- print firmware version
getVer
web function call #7    <-- print version of data image
web function call #9    <-- print errors, start at buffer start
errorOutput
web buf len 947
web function call #9    <-- duplicate
errorOutput
web buf len 947
web function call #10   <-- print errors, continue from current buf location
errorOutput
web buf len 0
web function call #8    <-- insert footer
web function call #0    <-- duplicate
web function call #1    <-- duplicate
web function call #2    <-- duplicate
web function call #3    <-- duplicate
web function call #4    <-- duplicate
feedback
web function call #5    <-- duplicate
web function call #6    <-- duplicate
getVer
web function call #7    <-- duplicate
web function call #8    <-- duplicate
Even if I request a webpage with just a single line of plain text as its content I end up with:

Code: Select all

web function call #0
web function call #1
web function call #2
web function call #3
web function call #4
feedback
web function call #5
web function call #6
getVer
web function call #7
web function call #8
although the functions were never to be called.

I am a bit lost on what might be causing this behaviour and compared all source files of my lib_webserver module with a fresh download. They are identical, except that I changed everyting flash related to quadflash (not using flash for the website, but had to change everyting so i can include the library for quadflash devices). makefs.py is identical as well.


Post Reply