OwlCyberSecurity - MANAGER
Edit File: socket.cpython-312.pyc
� G��ga � � � d dl Z d dlZd dlmZ d dlmZ d dlmZ erd dl mZm Z d dl mZmZm Z mZ dgZ G d� de� Zd � Zd � Zd� Zy)� N)�MYPY)�OP)�Integration)� AddressFamily� SocketKind)�Tuple�Optional�Union�List�SocketIntegrationc �* � e Zd ZdZde� �Zed� � Zy)r �socketzauto.socket.c �, � t � t � y)zs patches two of the most used functions of socket: create_connection and getaddrinfo(dns resolver) N)�_patch_create_connection�_patch_getaddrinfo� � �M/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/socket.py� setup_oncezSocketIntegration.setup_once s � � !�"��r N)�__name__� __module__�__qualname__� identifier�origin�staticmethodr r r r r r s% � ��J��J�<� (�F��� �r c � � | j � } |j � }| �d|��}|S # t t f$ r Y �+w xY w# t t f$ r Y �/w xY w)N�:)�decode�UnicodeDecodeError�AttributeError)�host�port�descriptions r �_get_span_descriptionr$ se � � ��{�{�}�� ��{�{�}�� "�4�(�K���� ��/� �� �� ��/� �� �s �, �A �>�>�A�Ac �h �� t j �t j d f�fd� } | t _ y )Nc � �� t j � j t � }|� �| ||� S t j t j t | d | d � t j �� 5 }|j d| � |j d|� |j d|� �| ||�� cd d d � S # 1 sw Y y xY w)Nr � ��op�namer �address�timeout�source_address)r+ r, r- ) � sentry_sdk� get_client�get_integrationr � start_spanr �SOCKET_CONNECTIONr$ r �set_data)r+ r, r- �integration�span�real_create_connections �r �create_connectionz3_patch_create_connection.<locals>.create_connection2 s� �� � !�+�+�-�=�=�>O�P����)�'�7�N�K�K� � "� "��#�#�&�w�q�z�7�1�:�>�$�+�+� � ��M�M�)�W�-��M�M�)�W�-��M�M�*�N�;�)����� � � �s �9AC�C )r r7 �_GLOBAL_DEFAULT_TIMEOUT)r7 r6 s @r r r . s, �� �#�5�5�� �.�.���. 1�F�r c �H �� t j �d�fd� } | t _ y )Nc �z �� t j � j t � }|� �| |||||� S t j t j t | |� t j �� 5 }|j d| � |j d|� �| |||||� cd d d � S # 1 sw Y y xY w)Nr( r! r"