From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=1.0 required=3.0 tests=AWL,HK_RANDOM_FROM, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: client_max_body_size param coming Date: Fri, 30 Apr 2010 01:36:53 +0000 Message-ID: <20100430013653.GA27483@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1272592325 31404 80.91.229.12 (30 Apr 2010 01:52:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Apr 2010 01:52:05 +0000 (UTC) To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Fri Apr 30 03:52:04 2010 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:80 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O7fOc-0001bq-U7 for gclrrg-rainbows-talk@m.gmane.org; Fri, 30 Apr 2010 03:52:03 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id EF50C1858316; Thu, 29 Apr 2010 21:52:01 -0400 (EDT) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id 455D318582C7 for ; Thu, 29 Apr 2010 21:36:54 -0400 (EDT) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id 5FAD51F68F; Fri, 30 Apr 2010 01:36:53 +0000 (UTC) Hi all, There are currently no limits to the size of an HTTP request body. I'm leaning towards making the default limit 1 megabyte (same as nginx). This means if you're currently running Rainbows! and processing large uploads, upgrading to a future version will require you to configure this parameter. I'm adding this because it's possible for somebody with a high bandwidth connection to run your server out of disk space. This is because Rack (unfortunately) requires request bodies to be rewindable. This primarily affects the EventMachine, NeverBlock and Rev backends. They buffer the entire request body before dispatching to the Rack app, so there's no chance for middleware to intercept calls to "rack.input" to avoid the flood. The rest of the concurrency models that use TeeInput never actually read request bodies off the socket until the data is needed (though Rack::Request used by most apps will also read it for POST params), so I'm thinking about introducing middleware to wrap TeeInput and have it automatically added to the stack. I don't like automatically throwing middleware into things, but I think having consistent behavior for: Rainbows! do use :Foo client_max_body_size 10*1024*1024 end is important, as it only involves reconfiguring Rainbows! Rainbows! will would return a "413 Request Entity Too Large" error in cases when the body is too large and close the connection. This will only affect Rainbows! and Zbatery. I won't add this to Unicorn since Unicorn was only designed to run behind nginx (and trusted local clients). Since Unicorn always uses TeeInput, anybody who really wants it can add the new middleware to their stack. Thanks for reading. -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying