![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /lib/python2.7/site-packages/requests_toolbelt/adapters/ |
� ӵ Yc @ s� d Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d e j f d � � YZ d e f d � � YZ d S( s/ The implementation of the SocketOptionsAdapter.i����N( t adaptersi ( t connection( t poolmanager( t exceptionst SocketOptionsAdapterc B sr e Z d Z e d k rB e e j d e j e j d f g � Z n g Z e j e j d � d � Z e d � Z RS( sd An adapter for requests that allows users to specify socket options. Since version 2.4.0 of requests, it is possible to specify a custom list of socket options that need to be set before establishing the connection. Example usage:: >>> import socket >>> import requests >>> from requests_toolbelt.adapters import socket_options >>> s = requests.Session() >>> opts = [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 0)] >>> adapter = socket_options.SocketOptionsAdapter(socket_options=opts) >>> s.mount('http://', adapter) You can also take advantage of the list of default options on this class to keep using the original options in addition to your custom options. In that case, ``opts`` might look like:: >>> opts = socket_options.SocketOptionsAdapter.default_options + opts t default_socket_optionsi s� This version of Requests is only compatible with a version of urllib3 which is too old to support setting options on a socket. This adapter is functionally useless.c K s2 | j d | j � | _ t t | � j | � d S( Nt socket_options( t popt default_optionsR t superR t __init__( t selft kwargs( ( sM /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/socket_options.pyR 4 s c C s\ t j d k r<