(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None)
| 395 | raise GeneralProxyError((4, _generalerrors[4])) |
| 396 | |
| 397 | def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, |
| 398 | source_address=None): |
| 399 | # Patched for a DNS-leakage |
| 400 | host, port = address |
| 401 | sock = None |
| 402 | try: |
| 403 | sock = socksocket(socket.AF_INET, socket.SOCK_STREAM) |
| 404 | if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT: |
| 405 | sock.settimeout(timeout) |
| 406 | if source_address: |
| 407 | sock.bind(source_address) |
| 408 | sock.connect(address) |
| 409 | except socket.error: |
| 410 | if sock is not None: |
| 411 | sock.close() |
| 412 | raise |
| 413 | return sock |
nothing calls this directly
no test coverage detected
searching dependent graphs…