in reply to Altering data in STDIN

You can't open a pipe, fork off the CGI app with the pipe as STDIN, and feed it the data yourself?

"Ungetting" back to STDIN isn't something I know how to do. That doesn't mean it's impossible, but it wouldn't surprise me. Some systems have input streams where you can "unget" a few characters, but the entire contents of the stream might be a bit much to ask...


Mike

Replies are listed 'Best First'.
Re^2: Altering data in STDIN
by ionsphere (Initiate) on Sep 02, 2008 at 11:11 UTC
    I have only one misunderstanding:
    if I have forked off CGI app and it gave it's result to the real STDOUT, how can I stop Apache from moving on through the handler's chain and launching this application again?

    return OK; - says to Apache that all is fine and it can move on.
    return AUTH_REQUIRED; - says to stop and return 401 to the user.

    The rest of the returns:
    Apache2::Const::AUTH_REQUIRED Apache2::Const::DECLINED Apache2::Const::DONE Apache2::Const::FORBIDDEN Apache2::Const::NOT_FOUND Apache2::Const::OK Apache2::Const::REDIRECT Apache2::Const::SERVER_ERROR
    just seem useless.
      I was thinking more in terms of replacing x.cgi with an intermediate script, and having the intermediate fork off and call the real x...

      Mike