forked from j62/ctbrec
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"));
|
addProxyConfig(jsonConfig.getJSONObject("config"));
|
||||||
|
|
||||||
if (LOG.isTraceEnabled()) {
|
|
||||||
p = new ProcessBuilder(OS.getBrowserCommand("--enable-logging")).start();
|
|
||||||
new StreamRedirectThread(p.getInputStream(), System.err);
|
|
||||||
new StreamRedirectThread(p.getErrorStream(), System.err);
|
|
||||||
} else {
|
|
||||||
p = new ProcessBuilder(OS.getBrowserCommand()).start();
|
p = new ProcessBuilder(OS.getBrowserCommand()).start();
|
||||||
new StreamRedirectThread(p.getInputStream(), OutputStream.nullOutputStream());
|
if (LOG.isTraceEnabled()) {
|
||||||
new StreamRedirectThread(p.getErrorStream(), OutputStream.nullOutputStream());
|
new Thread(new StreamRedirectThread(p.getInputStream(), System.out)).start();
|
||||||
|
new Thread(new StreamRedirectThread(p.getErrorStream(), System.err)).start();
|
||||||
|
} else {
|
||||||
|
new Thread(new StreamRedirectThread(p.getInputStream(), OutputStream.nullOutputStream())).start();
|
||||||
|
new Thread(new StreamRedirectThread(p.getErrorStream(), OutputStream.nullOutputStream())).start();
|
||||||
}
|
}
|
||||||
LOG.debug("Browser started");
|
LOG.debug("Browser started");
|
||||||
|
|
||||||
|
@ -95,6 +94,7 @@ public class ExternalBrowser implements AutoCloseable {
|
||||||
out = socket.getOutputStream();
|
out = socket.getOutputStream();
|
||||||
reader = new Thread(this::readBrowserOutput);
|
reader = new Thread(this::readBrowserOutput);
|
||||||
reader.start();
|
reader.start();
|
||||||
|
LOG.debug("Connected to control socket");
|
||||||
return;
|
return;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if(i == 19) {
|
if(i == 19) {
|
||||||
|
|
Loading…
Reference in New Issue