Skip to content
Snippets Groups Projects
Commit 3e9ba863 authored by Mark D. Roth's avatar Mark D. Roth
Browse files

Merge branch 'security_handshaker1' into security_handshaker2

parents 71403820 8aa2f70f
No related branches found
No related tags found
No related merge requests found
...@@ -126,6 +126,9 @@ static void handshake_failed_locked(grpc_exec_ctx* exec_ctx, ...@@ -126,6 +126,9 @@ static void handshake_failed_locked(grpc_exec_ctx* exec_ctx,
// Not shutting down, so the handshake failed. Clean up before // Not shutting down, so the handshake failed. Clean up before
// invoking the callback. // invoking the callback.
cleanup_args_for_failure_locked(handshaker); cleanup_args_for_failure_locked(handshaker);
// Set shutdown to true so that subsequent calls to
// http_connect_handshaker_shutdown() do nothing.
handshaker->shutdown = true;
} }
// Invoke callback. // Invoke callback.
grpc_exec_ctx_sched(exec_ctx, handshaker->on_handshake_done, error, NULL); grpc_exec_ctx_sched(exec_ctx, handshaker->on_handshake_done, error, NULL);
......
...@@ -49,12 +49,22 @@ measure_cpu_costs = False ...@@ -49,12 +49,22 @@ measure_cpu_costs = False
_DEFAULT_MAX_JOBS = 16 * multiprocessing.cpu_count() _DEFAULT_MAX_JOBS = 16 * multiprocessing.cpu_count()
_MAX_RESULT_SIZE = 8192 _MAX_RESULT_SIZE = 8192
# NOTE: If you change this, please make sure to test reviewing the
# github PR with http://reviewable.io, which is known to add UTF-8
# characters to the PR description, which leak into the environment here
# and cause failures.
def strip_non_ascii_chars(s):
return ''.join(c for c in s if ord(c) < 128)
def sanitized_environment(env): def sanitized_environment(env):
sanitized = {} sanitized = {}
for key, value in env.items(): for key, value in env.items():
sanitized[str(key).encode()] = str(value).encode() sanitized[strip_non_ascii_chars(key)] = strip_non_ascii_chars(value)
return sanitized return sanitized
def platform_string(): def platform_string():
if platform.system() == 'Windows': if platform.system() == 'Windows':
return 'windows' return 'windows'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment