Repository URL to install this package:
| 
      
     
      
        
        
        Version: 
        
         
  
        
    
          
          4.3.1-4.3  ▾
        
         
  
      
        
      
  
      
  
     | 
    
    python3-dmapi-el9
  
    /
        
    usr
  
        /
        
    lib
  
        /
        
    python3.9
  
        /
        
    site-packages
  
        /
        
    dmapi
  
        /
        
    __pycache__
  
        /
        wsgi.cpython-39.pyc
    | 
|---|
a
    èÉe¹@  ã                   @   sJ  d Z ddlZddlZddlZddlZddlZddlZddlZddl	m
Z ddlm
Z
 ddlmZ ddlmZ ddlZddlZddlZddlZddlZddlmZ ddlmZmZmZ dd	lmZ ej j!Z!e "e#¡Z$G d
d de
j%Z&G dd
 d
ej'Z'G dd de(Z)G dd de)Z*G dd de*Z+G dd de(Z,G dd de(Z-dS )z.Utility methods for working with WSGI servers.é    N)Úlog)Úservice)Úexcutils)Údeploy)Ú	exception)Ú_Ú_LEÚ_LI)Úutilsc                   @   sT   e Zd ZdZejjZdddejjdddfddZ	d	d
 Z
dd Zd
d Zdd Z
dS )ÚServerzAServer class to manage a WSGI server, serving a WSGI application.z0.0.0.0r   Né   Fc
           
   	   C   sX  t jjtj_|| _|| _d| _|| _|p,| j	| _
t | j
¡| _t
 d| j ¡| _|| _|	| _t jjpfd| _|dk rtjtdd||f}
z4t |
d |
d tjtj¡d }|d }|d }
W n tyÖ   tj}Y n0 ztj|
||d| _W n, ty   t  t!d	||d
¡  Y n0 | j "¡ dd
 \| _#| _$t %t&d| j| j#| j$d
¡ dS )a  Initialize, but do not start, a WSGI server.
        :param name: Pretty name for logging.
        :param app: The WSGI application to serve.
        :param host: IP address to serve the application.
        :param port: Port number to server the application.
        :param pool_size: Maximum number of eventlets to spawn concurrently.
        :param backlog: Maximum number of queued connections.
        :param max_url_len: Maximum length of permitted URLs.
        :returns: None
        :raises: dmapi.exception.InvalidInput
        Nzdmapi.%s.wsgi.serveré   zThe backlog must be more than 0)Úreasonr   éÿÿÿÿ)Úbacklogz#Could not bind to %(host)s:%(port)s)ÚhostÚporté   z'%(name)s listening on %(host)s:%(port)s©Únamer   r   )'ÚCONFÚwsgiZmax_header_lineÚeventletZMAX_HEADER_LINEr   ÚappÚ_serverÚ	_protocolÚdefault_pool_sizeÚ	pool_sizeZ	GreenPoolÚ_poolÚloggingÚ	getLoggerÚ_loggerÚ_use_sslÚ_max_url_lenÚclient_socket_timeoutr   ZInvalidInputr   ÚsocketZgetaddrinfoZ	AF_UNSPECZSOCK_STREAMÚ	ExceptionZAF_INETZlistenÚ_socketÚEnvironmentErrorÚLOGÚerrorr   Zgetsocknamer   r   Úinfor	   )
Úselfr   r   r   r   r   Úprotocolr   Zuse_sslZmax_url_lenZ	bind_addrr+   Zfamily© r.   ú./usr/lib/python3.9/site-packages/dmapi/wsgi.pyÚ__init__(   sN    ÿ
ýý
ÿ
ÿzServer.__init__c                 C   sà  | j  ¡ }| tjtjd¡ | tjtjd¡ ttdrN| tjtj	t
jj¡ | j
rzÔt
jj}t
jj}t
jj}|rtj |¡sttd| |r°tj |¡s°ttd| |rÐtj |¡sÐttd| | j
rê|rÞ|sêttdd||tjd}t
jjr||d	<