Am 06.08.2013 11:51, schrieb Julian Wiesener: > Hi Oliver, > > while it would not be difficult to add a default CGI component and could > make it easier to adopt tntnet for some use-cases, i also think it's a > bad idea to use tntnet in that way. You would loose all benefits of > tntnet, as you'll need to fork a child and execute external commands > (runtime interpreted in your case) which could be done (possible better) > as well with nginx or apache or any other webserver that supports CGI > execution. > > In your case it would be much more efficient just to use the > gethostname() system call inside a <cpp> block and return the result. > You would no need to fork, no need to check if the UrlMap expression > could be misused by URL Parameters like > "../../../../../usr/bin/wget ..." and the code is not more complicated > that the shell oneliner. > > > > Regards, > Julian > Hi,
I'm back from vacation. gethostname is a good example. You should always check, if there is a API to do the same thing. strace is a great command to look, which system calls are used by a specific command line tool. But still CGI might still be a interesting addition. I once started to write it but did not finish it since there is really a danger, that it is used too often. The suggested exec@tntnet is not really enough, since there should be a way to specify at least the content type. Tommi ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
