You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Torsten Förtsch <to...@gmx.net> on 2013/01/19 20:21:09 UTC

Is it intentional that the Timeout must hit twice for a CGI script to be killed?

Hi,

cgi_handler() in 2.2 contains these lines. For trunk they look very similar.

    if (!nph) {
        const char *location;
        char sbuf[MAX_STRING_LEN];
        int ret;

        if ((ret = ap_scan_script_header_err_brigade(r, bb, sbuf))) {
            ret = log_script(r, conf, ret, dbuf, sbuf, bb, script_err);

Now, if the script does not generate any output not even headers
ap_scan_script_header_err_brigade() polls the script's stdout and stderr
until the timeout is reached. Then log_script() is called which calls
discard_script_output() and, thus, again ends up in cgi_bucket_read()
waiting for the second timeout.

Is that intentional?

Torsten