httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ras...@vex.net
Subject reset_timeout() in mod_cgi
Date Sun, 15 Dec 1996 17:18:18 GMT
File uploads that take longer than the default 400 seconds defined in 
httpd.conf were timing out for people using mod_php.  I added a reset_timeout()
call to the client block read loop.  It now looks like this:

    hard_timeout("copy script args", php_rqst);
    handler = signal(SIGPIPE, SIG_IGN);
    while((len_read = get_client_block (php_rqst, argsbuffer,
HUGE_STRING_LEN))) {
        if((dbpos + len_read) > length) dbsize = length - dbpos;
        else dbsize = len_read;
        reset_timeout(php_rqst);
        memcpy(buf + dbpos, argsbuffer, dbsize);
        dbpos += dbsize;
    }
    signal(SIGPIPE, handler);
    kill_timeout(php_rqst);

This seems to have fixed the problem.  Should the same not be done to 
mod_cgi.c?  It uses exactly the same mechanism to read from the client, and
it should have exactly the same problem with long file uploads.

-Rasmus

Mime
View raw message