You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/01/22 17:03:41 UTC

[PATCH] for mod_cgi.c (fwd)

I forget who it was who added the timeout for slow POST/PUTs. Whoever
it was, would they please review this 'fix'.

---------- Forwarded message ----------
Date: Wed, 22 Jan 1997 09:39:45 -0500 (EST)
From: Arthur Smith 516-344-6231 <ap...@aps.org>
To: Rob Hartill <ro...@imdb.com>
Subject: Patch for mod_cgi.c

Ok, here's the blurb and patch (it does work - I've tested it on
very long transfers with a 60 second timeout with no problems. 10 seconds
did have some problems but I think that was because something else was
timing out):

The "reset_timeout" line was inserted in 1.2beta3 to allow
large or slow POST/PUT operations.  However, it was placed
incorrectly so that it only took effect if CGI logging was
enabled. The follow patch moves the reset_timeout to the proper location:

*** mod_cgi_orig.c Tue Dec 24 15:03:23 1996
--- mod_cgi.c Tue Jan 21 16:41:58 1997
***************
*** 432,441 ****
                  else {
                      dbsize = len_read;
                  }
-                 reset_timeout(r);
                  memcpy(dbuf + dbpos, argsbuffer, dbsize);
  		dbpos += dbsize;
  	    }
  	    if (fwrite(argsbuffer, 1, len_read, script_out) < (size_t)len_read) {
  		/* silly script stopped reading, soak up remaining message */
  	        while (get_client_block(r, argsbuffer, HUGE_STRING_LEN) > 0)
--- 432,441 ----
                  else {
                      dbsize = len_read;
                  }
                  memcpy(dbuf + dbpos, argsbuffer, dbsize);
  		dbpos += dbsize;
  	    }
+             reset_timeout(r);
  	    if (fwrite(argsbuffer, 1, len_read, script_out) < (size_t)len_read) {
  		/* silly script stopped reading, soak up remaining message */
  	        while (get_client_block(r, argsbuffer, HUGE_STRING_LEN) > 0)




Re: [PATCH] for mod_cgi.c (fwd)

Posted by ra...@mail1.bellglobal.com.
> I forget who it was who added the timeout for slow POST/PUTs. Whoever
> it was, would they please review this 'fix'.

'twas I.

He is correct about the fact that the reset was in the wrong place.  I
always have CGI logging enabled and thus didn't catch it.  

+1 on applying his exact patch.

> *** mod_cgi_orig.c Tue Dec 24 15:03:23 1996
> --- mod_cgi.c Tue Jan 21 16:41:58 1997
> ***************
> *** 432,441 ****
>                   else {
>                       dbsize = len_read;
>                   }
> -                 reset_timeout(r);
>                   memcpy(dbuf + dbpos, argsbuffer, dbsize);
>             dbpos += dbsize;
>            }
>            if (fwrite(argsbuffer, 1, len_read, script_out) <
>            (size_t)len_read) {  /* silly script stopped reading, soak up
>            remaining message */     while (get_client_block(r, argsbuffer,
>            HUGE_STRING_LEN) > 0) 
> --- 432,441 ----
>                   else {
>                       dbsize = len_read;
>                   }
>                   memcpy(dbuf + dbpos, argsbuffer, dbsize);
>             dbpos += dbsize;
>            }
> +             reset_timeout(r);
>            if (fwrite(argsbuffer, 1, len_read, script_out) <
>            (size_t)len_read) {  /* silly script stopped reading, soak up
>            remaining message */     while (get_client_block(r, argsbuffer,
>            HUGE_STRING_LEN) > 0) 

-Rasmus