Make sure to actually start the stream redirect threads
This commit is contained in:
parent
dfb1083c45
commit
2dbc6015d2
|
@ -47,14 +47,13 @@ public class ExternalBrowser implements AutoCloseable {
|
|||
|
||||
addProxyConfig(jsonConfig.getJSONObject("config"));
|
||||
|
||||
p = new ProcessBuilder(OS.getBrowserCommand()).start();
|
||||
if (LOG.isTraceEnabled()) {
|
||||
p = new ProcessBuilder(OS.getBrowserCommand("--enable-logging")).start();
|
||||
new StreamRedirectThread(p.getInputStream(), System.err);
|
||||
new StreamRedirectThread(p.getErrorStream(), System.err);
|
||||
new Thread(new StreamRedirectThread(p.getInputStream(), System.out)).start();
|
||||
new Thread(new StreamRedirectThread(p.getErrorStream(), System.err)).start();
|
||||
} else {
|
||||
p = new ProcessBuilder(OS.getBrowserCommand()).start();
|
||||
new StreamRedirectThread(p.getInputStream(), OutputStream.nullOutputStream());
|
||||
new StreamRedirectThread(p.getErrorStream(), OutputStream.nullOutputStream());
|
||||
new Thread(new StreamRedirectThread(p.getInputStream(), OutputStream.nullOutputStream())).start();
|
||||
new Thread(new StreamRedirectThread(p.getErrorStream(), OutputStream.nullOutputStream())).start();
|
||||
}
|
||||
LOG.debug("Browser started");
|
||||
|
||||
|
@ -95,6 +94,7 @@ public class ExternalBrowser implements AutoCloseable {
|
|||
out = socket.getOutputStream();
|
||||
reader = new Thread(this::readBrowserOutput);
|
||||
reader.start();
|
||||
LOG.debug("Connected to control socket");
|
||||
return;
|
||||
} catch (IOException e) {
|
||||
if(i == 19) {
|
||||
|
|
Loading…
Reference in New Issue