mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:23:39 +03:00
websocket: fix curl_ws_recv()
- when data arrived in several chunks, the collection into the passed buffer always started at offset 0, overwriting the data already there. adding test_20_07 to verify fix - debug environment var CURL_WS_CHUNK_SIZE can be used to influence the buffer chunk size used for en-/decoding. Closes #12945
This commit is contained in:
parent
e3461bbd05
commit
f0c446ab57
4 changed files with 37 additions and 6 deletions
|
|
@ -45,10 +45,12 @@ log = logging.getLogger(__name__)
|
|||
class LocalClient:
|
||||
|
||||
def __init__(self, name: str, env: Env, run_dir: Optional[str] = None,
|
||||
timeout: Optional[float] = None):
|
||||
timeout: Optional[float] = None,
|
||||
run_env: Optional[Dict[str,str]] = None):
|
||||
self.name = name
|
||||
self.path = os.path.join(env.project_dir, f'tests/http/clients/{name}')
|
||||
self.env = env
|
||||
self._run_env= run_env
|
||||
self._timeout = timeout if timeout else env.test_timeout
|
||||
self._curl = os.environ['CURL'] if 'CURL' in os.environ else env.curl
|
||||
self._run_dir = run_dir if run_dir else os.path.join(env.gen_dir, name)
|
||||
|
|
@ -95,7 +97,7 @@ class LocalClient:
|
|||
with open(self._stderrfile, 'w') as cerr:
|
||||
p = subprocess.run(myargs, stderr=cerr, stdout=cout,
|
||||
cwd=self._run_dir, shell=False,
|
||||
input=None,
|
||||
input=None, env=self._run_env,
|
||||
timeout=self._timeout)
|
||||
exitcode = p.returncode
|
||||
except subprocess.TimeoutExpired:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue