geventhttpclient 2.3.8__tar.gz → 2.3.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {geventhttpclient-2.3.8/src/geventhttpclient.egg-info → geventhttpclient-2.3.9}/PKG-INFO +1 -1
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/pyproject.toml +1 -1
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/__init__.py +1 -1
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/connectionpool.py +14 -11
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9/src/geventhttpclient.egg-info}/PKG-INFO +1 -1
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/LICENSE-MIT +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/MANIFEST.in +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/README.md +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/ext/Python_compat.h +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/ext/_parser.c +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/llhttp/LICENSE-MIT +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/llhttp/include/llhttp.h +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/llhttp/src/api.c +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/llhttp/src/http.c +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/llhttp/src/llhttp.c +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/setup.cfg +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/setup.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/api.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/client.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/header.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/httplib.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/httplib2.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/requests.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/response.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/url.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient/useragent.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient.egg-info/SOURCES.txt +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient.egg-info/dependency_links.txt +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient.egg-info/requires.txt +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient.egg-info/top_level.txt +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_client.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_headers.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_httplib.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_httplib2.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_keep_alive.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_network_failures.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_no_module_ssl.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_parser.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_requests.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_ssl.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_url.py +0 -0
- {geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/tests/test_useragent.py +0 -0
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "geventhttpclient"
|
|
8
|
-
version = "2.3.
|
|
8
|
+
version = "2.3.9" # don't forget to update version __init__.py as well
|
|
9
9
|
description = "HTTP client library for gevent"
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
requires-python = ">=3.9"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# package
|
|
2
2
|
|
|
3
|
-
__version__ = "2.3.
|
|
3
|
+
__version__ = "2.3.9" # don't forget to update version in pyproject.toml as well
|
|
4
4
|
|
|
5
5
|
from geventhttpclient.api import delete, get, head, options, patch, post, put, request
|
|
6
6
|
from geventhttpclient.client import HTTPClient
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import socket
|
|
3
|
+
import select
|
|
3
4
|
|
|
4
5
|
import gevent.queue
|
|
5
6
|
import gevent.socket
|
|
@@ -151,24 +152,26 @@ class ConnectionPool:
|
|
|
151
152
|
raise RuntimeError(f"Error response from Proxy server : {resp}")
|
|
152
153
|
|
|
153
154
|
def _is_socket_alive(self, sock):
|
|
154
|
-
"""
|
|
155
|
+
"""Check if a socket is still connected and alive.
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
Uses select() to check if socket is readable. An idle keep-alive socket
|
|
158
|
+
should NOT be readable.
|
|
158
159
|
|
|
159
|
-
|
|
160
|
+
Returns False if connection is closed or broken.
|
|
160
161
|
"""
|
|
162
|
+
if sock is None:
|
|
163
|
+
return False
|
|
161
164
|
try:
|
|
162
|
-
|
|
163
|
-
if
|
|
165
|
+
# Proactive check: A closed socket has a fileno of -1.
|
|
166
|
+
if sock.fileno() < 0:
|
|
164
167
|
return False
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
# If the socket is readable while idle, it's either a FIN or dirty.
|
|
169
|
+
ready_to_read, _, _ = select.select([sock], [], [], 0.0)
|
|
170
|
+
if ready_to_read:
|
|
167
171
|
return False
|
|
172
|
+
|
|
168
173
|
return True
|
|
169
|
-
except
|
|
170
|
-
return True
|
|
171
|
-
except OSError:
|
|
174
|
+
except (OSError, ValueError, socket.error):
|
|
172
175
|
return False
|
|
173
176
|
|
|
174
177
|
def get_socket(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient.egg-info/requires.txt
RENAMED
|
File without changes
|
{geventhttpclient-2.3.8 → geventhttpclient-2.3.9}/src/geventhttpclient.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|