Hi
I'm using the web server (httpd) from the lwIP (V2.13) with FreeRTOS.
The web server is running fine so far. A socket server is also running
(in it's own task) to implement a small command line. The web server
also has the ability to access the command line over HTTP requests. Both
the web and the socket server using the same command line parser
functionality. The parser is protected with a semaphore, because not all
commands on the command line are fully reentrant.
Problem: If both the socket and the web server using the parser at the
same time a deadlock could occurs, that is because the web server is
running in the TCP task context and the socket server is trying to use
the TCP task from inside the command line parser.
I enabled the LWIP_HTTPD_FS_ASYNC_READ and it's functionality and added
the required code. The CGI handler now creates an empty response file
and sends a message to the helper task. The helper task receives the
message, calls the command line parser and initiate to send back the
answer via a tcpip_callback() call.
With this implementation, it is possible to call the command line parser
outside of the TCP task context and not blocking the TCP task.
That works so far, but the answer time of this solution is 10 times
slower, than to call the command line parser directly in the CGI
handler. I measured the time between the receive of the HTTP request and
the call of the callback function passed by tcpip_callback() and that is
not the problem. It is something in the lwIP that slow down the answer.
Question:
- What could be the reason of the longer response time (about 250ms
instead of 20ms) ?
- Is it possible to let the web server (httpd) in it's own task ? Has
anyone done it already ?
Thank you very much for your help.
Regards, Roland
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users