| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/flup/server/__pycache__/ |
Upload File : |
�
#H\aS= � �. � d Z dZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
d� Zn# e$ r d� ZY nw xY wddl
mZ eed� � s$ ddlZn# e$ r ed� � �w xY wd � Zee_ G d
� de� � Zedk r� G d
� de� � Z ej � � Ze� ej ej d� � e� d� � e� ej � � ede�� � � e� � dS dS )zAllan Saddi <allan@saddi.com>z
$Revision$� Nc �~ � t j | � � � t j t j � � d S �N)�fcntl�fileno�F_SETFD�
FD_CLOEXEC��socks �;/usr/lib/python3/dist-packages/flup/server/preforkserver.py�setCloseOnExecr - s) � �
��D�K�K�M�M�5�=�%�2B�C�C�C�C�C� c � � d S r � r s r r r * s � ��r
)� get_errno�
socketpairz(Requires eunuchs module for Python < 2.4c �D � t j � � � \ } }t j | t j t j � � t j |t j t j � � }}t
j | � � t
j |� � ||fS r )�eunuchsr �socket�fromfd�AF_UNIX�SOCK_STREAM�os�close)�s1�s2�p�cs r r r ; sp � ��#�.�.�0�0���B��
�b�&�.�&�2D�E�E��
�b�&�.�&�2D�E�E�
��
������
�������!�t�r
c �f � e Zd ZdZ dd�Zd � Zd
� Zd� Zd� Zd
� Z d� Z
d� Zd� Zd� Z
d� Zd� Zd� ZdS )�
PreforkServerap
A preforked server model conceptually similar to Apache httpd(2). At
any given time, ensures there are at least minSpare children ready to
process new requests (up to a maximum of maxChildren children total).
If the number of idle children is ever above maxSpare, the extra
children are killed.
If maxRequests is positive, each child will only handle that many
requests in its lifetime before exiting.
jobClass should be a class whose constructor takes at least two
arguments: the client socket and client address. jobArgs, which
must be a list or tuple, is any additional (static) arguments you
wish to pass to the constructor.
jobClass should have a run() method (taking no arguments) that does
the actual work. When run() returns, the request is considered
complete and the child process moves to idle state.
� � �2 r Nr c � � || _ || _ t ||� � | _ || _ || _ || _ i | _ d S r )� _minSpare� _maxSpare�max�_maxChildren�_maxRequests� _jobClass�_jobArgs� _children)�self�minSpare�maxSpare�maxChildren�maxRequests�jobClass�jobArgss r �__init__zPreforkServer.__init__Y sE � �!���!�����+�6�6���'���!�����
� ����r
c � � d| _ d| _ | � � � |� d� � t |� � | j �r�t | j � � | j k r3| � |� � snt | j � � | j k �3d� | j � � � D � � }t |� � t | j � � k rd}nd} t j
|g g |� � \ }}}n:# t j $ r(}t |� � t j k r� Y d}~nd}~ww xY w|D ]�} |� d� � }n<# t j $ r*}|j
t j t j fv rY d}~�L� d}~ww xY w| j � � � D ]W\ }} || d u rH|r|d k | j | d
<