.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.network.client.AsyncHTTPTransportNoHttp Class Reference
+ Inheritance diagram for searx.network.client.AsyncHTTPTransportNoHttp:
+ Collaboration diagram for searx.network.client.AsyncHTTPTransportNoHttp:

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 handle_async_request (self, request)
 
None aclose (self)
 
 __aenter__ (self)
 
None __aexit__ (self, exc_type=None, exc_value=None, traceback=None)
 

Detailed Description

Block HTTP request

The constructor is blank because httpx.AsyncHTTPTransport.__init__ creates an SSLContext unconditionally:
https://github.com/encode/httpx/blob/0f61aa58d66680c239ce43c8cdd453e7dc532bfc/httpx/_transports/default.py#L271

Each SSLContext consumes more than 500kb of memory, since there is about one network per engine.

In consequence, this class overrides all public methods

For reference: https://github.com/encode/httpx/issues/2298

Definition at line 62 of file client.py.

Constructor & Destructor Documentation

◆ __init__()

searx.network.client.AsyncHTTPTransportNoHttp.__init__ ( self,
* args,
** kwargs )

Definition at line 75 of file client.py.

75 def __init__(self, *args, **kwargs):
76 # pylint: disable=super-init-not-called
77 # this on purpose if the base class is not called
78 pass
79

Member Function Documentation

◆ __aenter__()

searx.network.client.AsyncHTTPTransportNoHttp.__aenter__ ( self)

Definition at line 86 of file client.py.

86 async def __aenter__(self):
87 return self
88

◆ __aexit__()

None searx.network.client.AsyncHTTPTransportNoHttp.__aexit__ ( self,
exc_type = None,
exc_value = None,
traceback = None )

Definition at line 89 of file client.py.

94 ) -> None:
95 pass
96
97

◆ aclose()

None searx.network.client.AsyncHTTPTransportNoHttp.aclose ( self)

Definition at line 83 of file client.py.

83 async def aclose(self) -> None:
84 pass
85

◆ handle_async_request()

searx.network.client.AsyncHTTPTransportNoHttp.handle_async_request ( self,
request )

Definition at line 80 of file client.py.

80 async def handle_async_request(self, request):
81 raise httpx.UnsupportedProtocol('HTTP protocol is disabled')
82

The documentation for this class was generated from the following file: