Re: [asio-users] External scripts (POST) with HTTP server 3 example possible?
Brought to you by:
chris_kohlhoff
From: Ralf M. <rm...@am...> - 2010-05-27 04:34:33
|
Ralf M. wrote: > Hi, > forgive me I'm new to asio. > I wonder what is neccessary to call external scripts > from a HTML form with action POST ? Followup to my own posting: The main problem was how to get the output of a child process. But using boost.process (Boris Schaeling) I was able to solve it. Passing the params via environment is not finished yet (ie. the QUERYSTRING stuff or so). I used something like this: ... int exec_and_capture(....) { ... boost::mutex::scoped_lock scoped_lock(mutex); ioservice.reset(); context ctx; ctx.environment = self::get_environment(); ctx.stdout_behavior = capture_stream(); child c = mylaunch(Aargs, ctx); pistream& is = c.get_stdout(); sd_in.assign(is.handle().release()); begin_read(); ioservice.run(); status s = c.wait(); boost::system::error_code ec; sd_in.close(ec); ... } |