mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix ssh bug
This commit is contained in:
parent
da031ee61c
commit
6c62973048
@ -11,11 +11,13 @@
|
||||
* 【extra】 邮件发送后获取message-id(issue#I15FKR@Gitee)
|
||||
* 【core 】 CaseInsensitiveMap/CamelCaseMap增加toString(issue#636@Github)
|
||||
* 【core 】 XmlUtil多节点改进(issue#I15I0R@Gitee)
|
||||
* 【core 】 Thread.excAsync修正为execAsync(issue#642@Github)
|
||||
|
||||
### Bug修复
|
||||
* 【extra】 修复SFTP.upload上传失败的问题(issue#I15O40@Gitee)
|
||||
* 【db】 修复findLike匹配错误问题
|
||||
* 【core 】 修复scale方法透明无效问题(issue#I15L5S@Gitee)
|
||||
* 【extra】 修复exec返回无效(issue#I15L5S@Gitee)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class ThreadUtil {
|
||||
* @param isDaemon 是否守护线程。守护线程会在主线程结束后自动结束
|
||||
* @return 执行的方法体
|
||||
*/
|
||||
public static Runnable excAsync(final Runnable runnable, boolean isDaemon) {
|
||||
public static Runnable execAsync(final Runnable runnable, boolean isDaemon) {
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.setDaemon(isDaemon);
|
||||
thread.start();
|
||||
@ -432,6 +432,7 @@ public class ThreadUtil {
|
||||
* @param obj 对象所在线程
|
||||
* @since 4.5.6
|
||||
*/
|
||||
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
|
||||
public static void sync(Object obj) {
|
||||
synchronized (obj) {
|
||||
try {
|
||||
|
@ -356,13 +356,13 @@ public class JschUtil {
|
||||
if (null == charset) {
|
||||
charset = CharsetUtil.CHARSET_UTF_8;
|
||||
}
|
||||
final ChannelExec channel = (ChannelExec) openChannel(session, ChannelType.EXEC);
|
||||
final ChannelExec channel = (ChannelExec) createChannel(session, ChannelType.EXEC);
|
||||
channel.setCommand(StrUtil.bytes(cmd, charset));
|
||||
channel.setInputStream(null);
|
||||
channel.setErrStream(errStream);
|
||||
InputStream in = null;
|
||||
try {
|
||||
channel.start();
|
||||
channel.connect();
|
||||
in = channel.getInputStream();
|
||||
return IoUtil.read(in, CharsetUtil.CHARSET_UTF_8);
|
||||
} catch (IOException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user