mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-26 11:16:29 +00:00
Fix commands getting stuck on start failure
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
package io.xpipe.core.process;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class BufferedProcessInputStream extends BufferedInputStream {
|
||||
|
||||
public BufferedProcessInputStream(InputStream in, int size) {
|
||||
super(in, size);
|
||||
}
|
||||
|
||||
public int bufferedAvailable() {
|
||||
return count - pos;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public interface CommandControl extends ProcessControl {
|
||||
discardOrThrow();
|
||||
return true;
|
||||
} catch (ProcessOutputException ex) {
|
||||
if (ex.isTimeOut()) {
|
||||
if (ex.isIrregularExit()) {
|
||||
throw ex;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ public class ProcessOutputException extends Exception {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
public boolean isTimeOut() {
|
||||
return exitCode == CommandControl.EXIT_TIMEOUT_EXIT_CODE;
|
||||
public boolean isIrregularExit() {
|
||||
return exitCode == CommandControl.EXIT_TIMEOUT_EXIT_CODE || exitCode == CommandControl.START_FAILED_EXIT_CODE || exitCode == CommandControl.UNASSIGNED_EXIT_CODE || exitCode == CommandControl.INTERNAL_ERROR_EXIT_CODE;
|
||||
}
|
||||
|
||||
public boolean isKill() {
|
||||
|
||||
Reference in New Issue
Block a user