golden hour
/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-310.pyc
378 B
Del
OK
_locale_data.cpython-310.pyc
3.23 KB
Del
OK
auth.cpython-310.pyc
39.18 KB
Del
OK
autoreload.cpython-310.pyc
7.02 KB
Del
OK
concurrent.cpython-310.pyc
17.24 KB
Del
OK
curl_httpclient.cpython-310.pyc
12.8 KB
Del
OK
escape.cpython-310.pyc
9.89 KB
Del
OK
gen.cpython-310.pyc
38.39 KB
Del
OK
http1connection.cpython-310.pyc
19.47 KB
Del
OK
httpclient.cpython-310.pyc
25.19 KB
Del
OK
httpserver.cpython-310.pyc
11.45 KB
Del
OK
httputil.cpython-310.pyc
29.84 KB
Del
OK
ioloop.cpython-310.pyc
33.19 KB
Del
OK
iostream.cpython-310.pyc
42.97 KB
Del
OK
locale.cpython-310.pyc
15.22 KB
Del
OK
locks.cpython-310.pyc
16.61 KB
Del
OK
log.cpython-310.pyc
8.07 KB
Del
OK
netutil.cpython-310.pyc
14.32 KB
Del
OK
options.cpython-310.pyc
19.63 KB
Del
OK
process.cpython-310.pyc
10.27 KB
Del
OK
queues.cpython-310.pyc
11.29 KB
Del
OK
routing.cpython-310.pyc
21.08 KB
Del
OK
simple_httpclient.cpython-310.pyc
16.08 KB
Del
OK
stack_context.cpython-310.pyc
10.65 KB
Del
OK
tcpclient.cpython-310.pyc
6.49 KB
Del
OK
tcpserver.cpython-310.pyc
10.06 KB
Del
OK
template.cpython-310.pyc
30.52 KB
Del
OK
testing.cpython-310.pyc
24.61 KB
Del
OK
util.cpython-310.pyc
13.72 KB
Del
OK
web.cpython-310.pyc
105.22 KB
Del
OK
websocket.cpython-310.pyc
39.08 KB
Del
OK
wsgi.cpython-310.pyc
11.5 KB
Del
OK
Edit: netutil.cpython-310.pyc
o �xebQ � @ s� d Z ddlmZmZmZ ddlZddlZddlZddlZddl Z ddl mZmZ ddl mZ ddlmZ ddlmZmZmZ zddlZW n eyO dZY nw zddlZW n eyl edu sfeed�ridZn� Y nw erqeZeed �r�eed �r�ejZejZnedu r�d ZZnddlZ e jjZe jjZeed�r�eed�r�e�!ej"j#�Z$e�!ej"j%�Z&nCe�'ej(�Z$ej)e$_*e$�+e�,� � e�'ej(�Z&eed�r�e$ j-ej.O _-e& j-ej.O _-ner�e/ej)e�,� d �Z$i Z&ne/ddd �Z$i Z&d�0d� d�0d� ej1ej2fZ3eed��re3ej4f7 Z3dZ5dej6e5ddfdd�Z7eed��r)de5fdd�Z8d-dd�Z9dd� Z:G dd� de�Z;G d d!� d!e;�Z<G d"d#� d#e<�Z=G d$d%� d%e<�Z>G d&d'� d'e;�Z?e@g d(��ZAd)d*� ZBd-d+d,�ZCdS ).z#Miscellaneous network utility code.� )�absolute_import�division�print_functionN)�dummy_executor�run_on_executor)�IOLoop)�set_close_exec)�PY3�Configurable�errno_from_exception�create_default_context�match_hostname�CertificateError� SSLContext�OP_NO_COMPRESSION)� cert_reqs�ca_certsZfoo�idna�latin1�WSAEWOULDBLOCK� Fc C s� |rt td�std��g }|dkrd}tjs|tjkrtj}|du r%tj}d}tt�|| |tj d|��D ]�}|\} } }}} t jdkrR|dkrR| tjkrR| d dkrRq4z t�| | |�}W n tj yv } zt|�tjkrqW Y d}~q4� d}~ww t|�� � tjd kr�|�tjtjd � |r�|�tjtjd � | tjkr�t td�r�|�tjtjd � | dd� \}}|dkr�|dur�t||gt| dd� � �} |�d� |�| � |�� d }|� |� |�!|� q4|S ) a Creates listening sockets bound to the given port and address. Returns a list of socket objects (multiple sockets are returned if the given address maps to multiple IP addresses, which is most common for mixed IPv4 and IPv6 use). Address may be either an IP address or hostname. If it's a hostname, the server will listen on all IP addresses associated with the name. Address may be an empty string or None to listen on all available interfaces. Family may be set to either `socket.AF_INET` or `socket.AF_INET6` to restrict to IPv4 or IPv6 addresses, otherwise both will be used if available. The ``backlog`` argument has the same meaning as for `socket.listen() <socket.socket.listen>`. ``flags`` is a bitmask of AI_* flags to `~socket.getaddrinfo`, like ``socket.AI_PASSIVE | socket.AI_NUMERICHOST``. ``reuse_port`` option sets ``SO_REUSEPORT`` option for every socket in the list. If your platform doesn't support this option ValueError will be raised. �SO_REUSEPORTz)the platform doesn't support SO_REUSEPORT� Nr �darwinZ localhost� �nt� �IPPROTO_IPV6� )"�hasattr�socket� ValueError�has_ipv6� AF_UNSPEC�AF_INET� AI_PASSIVE�set�getaddrinfo�SOCK_STREAM�sys�platform�AF_INET6�errorr �errnoZEAFNOSUPPORTr �fileno�os�name� setsockopt� SOL_SOCKET�SO_REUSEADDRr r �IPV6_V6ONLY�tuple�list�setblocking�bind�getsockname�listen�append)�port�address�family�backlog�flags� reuse_portZsocketsZ bound_port�res�af�socktype�proto� canonnameZsockaddr�sock�e�hostZrequested_port� rJ �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/netutil.py�bind_socketss sT ��� rL �AF_UNIXi� c C s� t � t jt j�}t|�� � |�t jt jd� |�d� zt � | �}W n ty= } zt|�t jkr3� W Y d}~nd}~ww t �|j�rJt �| � ntd| ��|�| � t �| |� |�|� |S )a( Creates a listening unix socket. If a socket with the given name already exists, it will be deleted. If any other file with that name exists, an exception will be raised. Returns a socket object (not a list of socket objects like `bind_sockets`) r r Nz"File %s exists and is not a socket)r rM r( r r. r1 r2 r3 r7 r/ �stat�OSErrorr r- �ENOENT�S_ISSOCK�st_mode�remover! r8 �chmodr: )�file�moder? rG �st�errrJ rJ rK �bind_unix_socket� s&