ó
`¾Tc           @   s@   d  Z  d d l m Z d d l m Z d e f d „  ƒ  YZ d S(   s£  
    werkzeug.contrib.limiter
    ~~~~~~~~~~~~~~~~~~~~~~~~

    A middleware that limits incoming data.  This works around problems with
    Trac_ or Django_ because those directly stream into the memory.

    .. _Trac: http://trac.edgewall.org/
    .. _Django: http://www.djangoproject.com/

    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
iÿÿÿÿ(   t   warn(   t   LimitedStreamt   StreamLimitMiddlewarec           B   s#   e  Z d  Z d d „ Z d „  Z RS(   s@  Limits the input stream to a given number of bytes.  This is useful if
    you have a WSGI application that reads form data into memory (django for
    example) and you don't want users to harm the server by uploading tons of
    data.

    Default is 10MB

    .. versionchanged:: 0.9
       Deprecated middleware.
    i   i
   c         C   s&   t  t d ƒ ƒ | |  _ | |  _ d  S(   Ns   This middleware is deprecated(   R    t   DeprecationWarningt   appt   maximum_size(   t   selfR   R   (    (    s^   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/contrib/limiter.pyt   __init__    s    	c         C   sN   t  |  j t | j d ƒ p d ƒ ƒ } t | d | ƒ | d <|  j | | ƒ S(   Nt   CONTENT_LENGTHi    s
   wsgi.input(   t   minR   t   intt   getR   R   (   R   t   environt   start_responset   limit(    (    s^   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/contrib/limiter.pyt   __call__%   s    'i   i    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    s^   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/contrib/limiter.pyR      s   
N(   R   t   warningsR    t   werkzeug.wsgiR   t   objectR   (    (    (    s^   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/contrib/limiter.pyt   <module>   s   