httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Module timeout handling question
Date Fri, 13 Dec 1996 19:10:27 GMT
I am using the following to read a request from a client.  The problem
is that if a file upload takes longer than the default 400 seconds, it
times out.  The following is stolen directly from mod_cgi.c, so CGI's
have the same problem.

    if(should_client_block(php_rqst)) {
        void (*handler)();
        int dbsize, len_read,dbpos=0;

        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;
            strncpy(buf + dbpos, argsbuffer, dbsize);
            dbpos += dbsize;
        signal(SIGPIPE, handler);

Would it not make sense to add a call to reset_timeout() every time a block
is read?  As long as data is flowing, I don't think the request should 
time out.  At least for file uploads that can be many megabytes in length,
timing out in the middle is a very bad idea.


View raw message