Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752649152, "reponame":"openssl", "desc":"OpenSSL", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl", "f":3, "items": [ {"schema":"libjg2-1", "cid":"eda5a3743101f3b6131fb181dc44ab13", "commit": {"type":"commit", "time": 1523607121, "time_ofs": 120, "oid_tree": { "oid": "d29cf1a682e840edf40c2b41a08fdc9925d6f0d9", "alias": []}, "oid":{ "oid": "6b3e8b94301d1081e88d276eeb452668c8f13632", "alias": []}, "msg": "TLSProxy/Proxy.pm: handle -1 as return value from waitpid.", "sig_commit": { "git_time": { "time": 1523607121, "offset": 120 }, "name": "Andy Polyakov", "email": "appro@openssl.org", "md5": "50bd64fa2a792cbbf679fa16213a3b2a" }, "sig_author": { "git_time": { "time": 1523191499, "offset": 120 }, "name": "Andy Polyakov", "email": "appro@openssl.org", "md5": "50bd64fa2a792cbbf679fa16213a3b2a" }}, "body": "TLSProxy/Proxy.pm: handle -1 as return value from waitpid.\n\nOn rare occasion 's_server | perl -ne print' can complete before\ncorresponding waitpid, which on Windows can results in -1 return\nvalue. This is not an error, don't treat it like one. Collect\neven return value from s_server.\n\nReviewed-by: Bernd Edlinger \u003cbernd.edlinger@hotmail.de\u003e\nReviewed-by: Rich Salz \u003crsalz@openssl.org\u003e\n(Merged from https://github.com/openssl/openssl/pull/5907)\n" , "diff": "diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm\nindex b3b2fec..19b09a4 100644\n--- a/util/perl/TLSProxy/Proxy.pm\n+++ b/util/perl/TLSProxy/Proxy.pm\n@@ -243,7 +243,8 @@ sub start\n if ($self-\u003e{server_port} \u003d\u003d 0) {\n # This actually means that s_server exited, because otherwise\n # we would still searching for ACCEPT...\n- die \u0022no ACCEPT detected in '$execcmd' output\u005cn\u0022;\n+ waitpid($pid, 0);\n+ die \u0022no ACCEPT detected in '$execcmd' output: $?\u005cn\u0022;\n }\n \n # Just make sure everything else is simply printed [as separate lines].\n@@ -255,6 +256,7 @@ sub start\n if (eval { require Win32::Process; 1; }) {\n if (Win32::Process::Create(my $h, $^X, \u0022perl -ne print\u0022, 0, 0, \u0022.\u0022)) {\n $pid \u003d $h-\u003eGetProcessID();\n+ $self-\u003e{proc_handle} \u003d $h; # hold handle till next round [or exit]\n } else {\n $error \u003d Win32::FormatMessage(Win32::GetLastError());\n }\n@@ -412,11 +414,19 @@ sub clientstart\n my $pid;\n if (--$self-\u003e{serverconnects} \u003d\u003d 0) {\n $pid \u003d $self-\u003e{serverpid};\n- die \u0022serverpid is zero\u005cn\u0022 if $pid \u003d\u003d 0;\n- print \u0022Waiting for server process to close: $pid...\u005cn\u0022;\n- # recall that we wait on process that buffers server's output\n+ print \u0022Waiting for 'perl -ne print' process to close: $pid...\u005cn\u0022;\n+ $pid \u003d waitpid($pid, 0);\n+ if ($pid \u003e 0) {\n+ die \u0022exit code $? from 'perl -ne print' process\u005cn\u0022 if $? !\u003d 0;\n+ } elsif ($pid \u003d\u003d 0) {\n+ kill(3, $self-\u003e{real_serverpid});\n+ die \u0022lost control over $self-\u003e{serverpid}?\u0022;\n+ }\n+ $pid \u003d $self-\u003e{real_serverpid};\n+ print \u0022Waiting for s_server process to close: $pid...\u005cn\u0022;\n+ # it's done already, just collect the exit code [and reap]...\n waitpid($pid, 0);\n- die \u0022exit code $? from server process\u005cn\u0022 if $? !\u003d 0;\n+ die \u0022exit code $? from s_server process\u005cn\u0022 if $? !\u003d 0;\n } else {\n # It's a bit counter-intuitive spot to make next connection to\n # the s_server. Rationale is that established connection works\n@@ -425,7 +435,6 @@ sub clientstart\n $self-\u003econnect_to_server();\n }\n $pid \u003d $self-\u003e{clientpid};\n- die \u0022clientpid is zero\u005cn\u0022 if $pid \u003d\u003d 0;\n print \u0022Waiting for client process to close: $pid...\u005cn\u0022;\n waitpid($pid, 0);\n \n","s":{"c":1752649152,"u": 35263}} ],"g": 36143,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}