403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/flup/server/__pycache__/ajp_fork.cpython-311.pyc
�

#H\a����dZdZdZddlZddlZddlmZmZddlm	Z	dgZ
Gd�dee	��Zed	krAd
�Z
ddlmZeje
��Z
ee
ddej�
�����dSdS)a�
ajp - an AJP 1.3/WSGI gateway.

For more information about AJP and AJP connectors for your web server, see
<http://jakarta.apache.org/tomcat/connectors-doc/>.

For more information about the Web Server Gateway Interface, see
<http://www.python.org/peps/pep-0333.html>.

Example usage:

  #!/usr/bin/env python
  import sys
  from myapplication import app # Assume app is your WSGI application object
  from ajp import WSGIServer
  ret = WSGIServer(app).run()
  sys.exit(ret and 42 or 0)

See the documentation for WSGIServer for more information.

About the bit of logic at the end:
Upon receiving SIGHUP, the python script will exit with status code 42. This
can be used by a wrapper script to determine if the python script should be
re-run. When a SIGINT or SIGTERM is received, the script exits with status
code 0, possibly indicating a normal exit.

Example wrapper script:

  #!/bin/sh
  STATUS=42
  while test $STATUS -eq 42; do
    python "$@" that_script_above.py
    STATUS=$?
  done

Example workers.properties (for mod_jk):

  worker.list=foo
  worker.foo.port=8009
  worker.foo.host=localhost
  worker.foo.type=ajp13

Example httpd.conf (for mod_jk):

  JkWorkersFile /path/to/workers.properties
  JkMount /* foo

Note that if you mount your ajp application anywhere but the root ("/"), you
SHOULD specifiy scriptName to the WSGIServer constructor. This will ensure
that SCRIPT_NAME/PATH_INFO are correctly deduced.
zAllan Saddi <allan@saddi.com>z
$Revision$�N)�
BaseAJPServer�
Connection)�
PreforkServer�
WSGIServerc�6�eZdZdZddddejdfd�Zd�ZdS)ra�
    AJP1.3/WSGI server. Runs your WSGI application as a persistant program
    that understands AJP1.3. Opens up a TCP socket, binds it, and then
    waits for forwarded requests from your webserver.

    Why AJP? Two good reasons are that AJP provides load-balancing and
    fail-over support. Personally, I just wanted something new to
    implement. :)

    Of course you will need an AJP1.3 connector for your webserver (e.g.
    mod_jk) - see <http://jakarta.apache.org/tomcat/connectors-doc/>.
    �N)�	localhost�ITc��tj||||dd||||��
�
dD]	}	|	|vr||	=�
tj|ft|fd�|��dS)a�
        scriptName is the initial portion of the URL path that "belongs"
        to your application. It is used to determine PATH_INFO (which doesn't
        seem to be passed in). An empty scriptName means your application
        is mounted at the root of your virtual host.

        environ, which must be a dictionary, can contain any additional
        environment variables you want to pass to your application.

        bindAddress is the address to bind to, which must be a tuple of
        length 2. The first element is a string, which is the host name
        or IPv4 address of a local interface. The 2nd element is the port
        number.

        allowedServers must be None or a list of strings representing the
        IPv4 addresses of servers allowed to connect. None means accept
        connections from anywhere.

        loggingLevel sets the logging level of the module-level logger.
        FT)�
scriptName�environ�
multithreaded�multiprocess�bindAddress�allowedServers�loggingLevel�debug)rr�jobClass�jobArgs)rrN)r�__init__rr)
�self�applicationrr
rrrr�kw�keys
          �6/usr/lib/python3/dist-packages/flup/server/ajp_fork.pyrzWSGIServer.__init__gs���.	��t�[�*4�'.�-2�,0�+6�.<�,8�%*�	,�	,�	,�	,�L�	�	�C��b�y�y��s�G����t�P�j�4�'�P�P�R�P�P�P�P�P�c��|j�d|jj��	|���}nE#t
j$r3}|j�dt|����Yd}~dSd}~wwxYwtj	||��}|�
|��|j�d|jj|jrdpd��|S)z�
        Main loop. Call this after instantiating WSGIServer. SIGHUP, SIGINT,
        SIGQUIT, SIGTERM cause it to cleanup and return. (If a SIGHUP
        is caught, this method returns True. Returns False otherwise.)
        z%s starting upz#Failed to bind socket (%s), exitingNFz%s shutting down%sz (reload requested)r)�logger�info�	__class__�__name__�_setupSocket�socket�error�strr�run�_cleanupSocket�_hupReceived)r�sock�e�rets    rr&zWSGIServer.run�s���	
����)�4�>�+B�C�C�C�	��$�$�&�&�D�D���|�	�	�	��K���C�S��V�V�L�L�L��5�5�5�5�5�����	�������d�+�+�����D�!�!�!�����-�t�~�/F��*�D�/D�J��	L�	L�	L��
s�<�A>�(A9�9A>)r!�
__module__�__qualname__�__doc__�logging�INFOrr&�rrrrZsY��������02�4�0��%�l�$�#Q�#Q�#Q�#Q�J����r�__main__c
#�K�ddl}|ddg��dV�|���}|���|D]3}d|�d|�t	||�����d�V��4|�|d	|d
���}|jrdV�|jD]}d|j�d|j�d�V��d
V�dS)z(Probably not the most efficient example.rNz200 OK)zContent-Typez	text/htmlz\<html><head><title>Hello World!</title></head>
<body>
<p>Hello World!</p>
<table border="1">z<tr><td>z	</td><td>z</td></tr>
z
wsgi.input�)�fpr
�keep_blank_valuesz'<tr><th colspan="2">Form data</th></tr>z</table>
</body></html>
)	�cgi�keys�sort�escape�repr�FieldStorage�list�name�value)r
�start_responser7�namesr>�form�fields       r�test_apprD�s?�����
�
�
���x�"?�!@�A�A�A�#�	#�	#�	#�������
�
�
�����	7�	7�D�D����c�j�j��g�d�m�!4�!4�5�5�5�5�7�
7�
7�
7�
7����7�<�#8�'�23� �5�5���9�	<�;�;�;�;��Y�	)�	)�E�E��
�
�
�E�K�K�K�)�
)�
)�
)�
)�!�	!�	!�	!�	!�	!r)�validate)rr
)rrr)r.�
__author__�__version__r#r/�flup.server.ajp_baserr�flup.server.preforkserverr�__all__rr!rD�wsgirefrE�	validator�DEBUGr&r1rr�<module>rNs��62�2�h-�
���
�
�
�
�����:�:�:�:�:�:�:�:�3�3�3�3�3�3��.��G�G�G�G�G��
�G�G�G�R�z���!�!�!�4!� � � � � �!�x�!�(�+�+�H��J�x�%�d�#�M�+�+�+�+.�3�5�5�5�5�5�A�r

Youez - 2016 - github.com/yon3zu
LinuXploit