.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 58 of file client.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 71 of file client.py.

71 def __init__(self, *args, **kwargs):
72 # pylint: disable=super-init-not-called
73 # this on purpose if the base class is not called
74 pass
75

Member Function Documentation

◆ __aenter__()

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

Definition at line 82 of file client.py.

82 async def __aenter__(self):
83 return self
84

◆ __aexit__()

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

Definition at line 85 of file client.py.

90 ) -> None:
91 pass
92
93

◆ aclose()

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

Definition at line 79 of file client.py.

79 async def aclose(self) -> None:
80 pass
81

◆ handle_async_request()

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

Definition at line 76 of file client.py.

76 async def handle_async_request(self, request):
77 raise httpx.UnsupportedProtocol('HTTP protocol is disabled')
78

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