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__/scgi.cpython-311.pyc
�

#H\a����dZdZdZddlZddlZddlmZmZmZddl	m
Z
dgZGd�dee
��Ze
d	kr?d
�ZddlmZeje��Zeeej������dSdS)
a�
scgi - an SCGI/WSGI gateway.

For more information about SCGI and mod_scgi for Apache1/Apache2, see
<http://www.mems-exchange.org/software/scgi/>.

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 scgi 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
zAllan Saddi <allan@saddi.com>z
$Revision$�N)�BaseSCGIServer�
Connection�	NoDefault)�ThreadedServer�
WSGIServerc	�<�eZdZdZeddddddejdf	d�Zd�ZdS)ra
    SCGI/WSGI server. For information about SCGI (Simple Common Gateway
    Interface), see <http://www.mems-exchange.org/software/scgi/>.

    This server is similar to SWAP <http://www.idyll.org/~t/www-tools/wsgi/>,
    another SCGI/WSGI server.

    It differs from SWAP in that it isn't based on scgi.scgi_server and
    therefore, it allows me to implement concurrency using threads. (Also,
    this server was written from scratch and really has no other depedencies.)
    Which server to use really boils down to whether you want multithreading
    or forking. (But as an aside, I've found scgi.scgi_server's implementation
    of preforking to be quite superior. So if your application really doesn't
    mind running in multiple processes, go use SWAP. ;)
    NTF)�	localhosti�c
��tj||||||||||	|
���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 string or
        a tuple of length 2. If a tuple, the first element must be a string,
        which is the host name or IPv4 address of a local interface. The
        2nd element of the tuple is the port number. If a string, it will
        be interpreted as a filename and a UNIX socket will be opened.

        If binding to a UNIX socket, umask may be set to specify what
        the umask is to be changed to before the socket is created in the
        filesystem. After the socket is created, the previous umask is
        restored.
        
        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.
        )	�
scriptName�environ�
multithreaded�multiprocess�bindAddress�umask�allowedServers�loggingLevel�debug)�jobClass�jobArgsN)r�__init__rr)
�self�applicationrrr
rrrrrr�kw�keys
             �2/usr/lib/python3/dist-packages/flup/server/scgi.pyrzWSGIServer.__init__Zs���>	���k�+5�(/�.;�-9�,7�&+�/=�-9�&+�		-�		-�		-�		-�+�	�	�C��b�y�y��s�G�����	&�z�D�7�	&�	&�"$�	&�	&�	&�	&�	&�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)�)�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�����	����� ��t�,�,�����D�!�!�!�����-�t�~�/F��*�D�/D�J��	L�	L�	L��
s�<�A>�(A9�9A>)	r"�
__module__�__qualname__�__doc__r�logging�INFOrr'�rrrrJs]��������09�$�#�%�0�� $�%�l�$�	-&�-&�-&�-&�^����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_responser8�namesr?�form�fields       r�test_apprE�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)r)r/�
__author__�__version__r0r$�flup.server.scgi_baserrr�flup.server.threadedserverr�__all__rr"rE�wsgirefrF�	validator�DEBUGr'r2rr�<module>rOs��6"�"�H-�
�������
�
�
�
�G�G�G�G�G�G�G�G�G�G�5�5�5�5�5�5��.��T�T�T�T�T���T�T�T�l�z���!�!�!�4!� � � � � �!�x�!�(�+�+�H��J�x�#�M�+�+�+�+.�3�5�5�5�5�5�=�r

Youez - 2016 - github.com/yon3zu
LinuXploit