|From:||david . myers|
|Subject:||[libmicrohttpd] Spawning processes from access handler callback|
|Date:||Mon, 20 Apr 2015 15:56:34 +0000|
My embedded linux webserver uses thread-per-connection mode. Using either the linux system() call or the popen() call, I am issuing a linux "ifconfig" command in my access handler callback, every second, on command from a webpage. I wait for the result and return the result string to the webpage in the response string.
I find that after a variable number of minutes, I get a memory scribble which crashes my webserver application/daemon.
Any linux command seems to show the same problem so it's not related to the "ifconfig", it crashes the same with "ps" or "ls" commands.
Is there any reason why issuing system() or popen() calls in the callback might be unsafe?
Here's the code I call in the callback
int GetNetStats(MHD_Connection * connection, const char * szCommand)
/* Open the command for reading. */
strResponse += "</body></html>"; //terminate response string
|[Prev in Thread]||Current Thread||[Next in Thread]|