mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
Some ssl fixes (#919)
Fix return of wrap_socket. Add read, write, pending to SSLSocket Fix argument to socket.setdefaulttimeout
This commit is contained in:
committed by
Guido van Rossum
parent
06074e1e02
commit
6eca1a04da
@@ -361,5 +361,5 @@ def inet_aton(ip_string: str) -> str: ... # ret val 4 bytes in length
|
||||
def inet_ntoa(packed_ip: str) -> str: ...
|
||||
def inet_pton(address_family: int, ip_string: str) -> str: ...
|
||||
def inet_ntop(address_family: int, packed_ip: str) -> str: ...
|
||||
def getdefaulttimeout() -> Union[float, None]: ...
|
||||
def setdefaulttimeout(timeout: float) -> None: ...
|
||||
def getdefaulttimeout() -> Optional[float]: ...
|
||||
def setdefaulttimeout(timeout: Optional[float]) -> None: ...
|
||||
|
||||
@@ -148,6 +148,10 @@ class SSLSocket(socket.socket):
|
||||
def selected_npn_protocol(self) -> Optional[str]: ...
|
||||
def unwrap(self) -> socket.socket: ...
|
||||
def version(self) -> Optional[str]: ...
|
||||
def read(self, len: int = ...,
|
||||
buffer: Optional[bytearray] = ...) -> str: ...
|
||||
def write(self, buf: str) -> int: ...
|
||||
def pending(self) -> int: ...
|
||||
|
||||
|
||||
class SSLContext:
|
||||
@@ -178,7 +182,7 @@ class SSLContext:
|
||||
def wrap_socket(self, sock: socket.socket, server_side: bool = ...,
|
||||
do_handshake_on_connect: bool = ...,
|
||||
suppress_ragged_eofs: bool = ...,
|
||||
server_hostname: Optional[str] = ...) -> 'SSLContext': ...
|
||||
server_hostname: Optional[str] = ...) -> SSLSocket: ...
|
||||
def session_stats(self) -> Dict[str, int]: ...
|
||||
|
||||
|
||||
|
||||
@@ -357,5 +357,5 @@ def inet_aton(ip_string: str) -> bytes: ... # ret val 4 bytes in length
|
||||
def inet_ntoa(packed_ip: bytes) -> str: ...
|
||||
def inet_pton(address_family: int, ip_string: str) -> bytes: ...
|
||||
def inet_ntop(address_family: int, packed_ip: bytes) -> str: ...
|
||||
def getdefaulttimeout() -> Union[float, None]: ...
|
||||
def setdefaulttimeout(timeout: float) -> None: ...
|
||||
def getdefaulttimeout() -> Optional[float]: ...
|
||||
def setdefaulttimeout(timeout: Optional[float]) -> None: ...
|
||||
|
||||
@@ -229,7 +229,7 @@ class SSLContext:
|
||||
def wrap_socket(self, sock: socket.socket, server_side: bool = ...,
|
||||
do_handshake_on_connect: bool = ...,
|
||||
suppress_ragged_eofs: bool = ...,
|
||||
server_hostname: Optional[str] = ...) -> 'SSLContext': ...
|
||||
server_hostname: Optional[str] = ...) -> SSLSocket: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def wrap_bio(self, incoming: 'MemoryBIO', outgoing: 'MemoryBIO',
|
||||
server_side: bool = ...,
|
||||
|
||||
@@ -30,6 +30,7 @@ def url2pathname(path: str) -> str: ...
|
||||
def pathname2url(path: str) -> str: ...
|
||||
def getproxies() -> Dict[str, str]: ...
|
||||
def parse_http_list(s: str) -> List[str]: ...
|
||||
def parse_keqv_list(l: List[str]) -> Dict[str, str]: ...
|
||||
|
||||
class Request:
|
||||
if sys.version_info >= (3, 4):
|
||||
|
||||
Reference in New Issue
Block a user