I've tried to make http server with FatFS file system referring to web_server_sdcard_fatfs(https://github.com/GravitasCapstone/pic32-ethernet-sd/tree/master/web_server_sdcard_fatfs/firmware/src). The problem is that i can't understand the process from receive request to send response. The sample code doesn't contain file sending units. Then i guess how GET process works in http server. Figure shows the process that I guess.
Firstly, Web browser send GET request with url including valiables (url parameters). Secondly, The request is reached the web server and the url parameters are stored in the connection data buffer. Thirdly, File that linked to http requested file (index.html in this case) is automatically searched. Fourth, The searched directly for these files is mounted by SYS_FS_Mount() function written in app.c. Fifth, Response message consisted of http header and html body is automatically generated and send,and if the dynamic variables (inside a pair of tilde (~) ) are exists in html file, TCPIP_HTTP_Print fuunctions are automatically called and executed to replace the valiables. Sixth, TCPIP_HTTP_GetExecute function is automatically called when received GET request. The role of this function is not send requested file (index.html is automatically send by step 3,4 and 5 in this case).This function is implemented for analyze valiables and control output by the following the valiables.
Could someone please check my guess? Thank you in advance.