Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default size buf was used to read the command execution result, resulting in an incomplete command execution result. #70

Closed
Li4n0 opened this issue Sep 5, 2021 · 5 comments
Labels

Comments

@Li4n0
Copy link

Li4n0 commented Sep 5, 2021

func (ssh_conf *MakeConfig) Stream(command string, timeout ...time.Duration) (<-chan string, <-chan string, <-chan bool, <-chan error, error) {
	... ...
	// combine outputs, create a line-by-line scanner
	stdoutReader := io.MultiReader(outReader)
	stderrReader := io.MultiReader(errReader)
	stdoutScanner := bufio.NewScanner(stdoutReader)
	stderrScanner := bufio.NewScanner(stderrReader)
	... ...

The default buf size is 4096. This results in an incomplete output when the command stdout or stderr is greater than this value

@Li4n0
Copy link
Author

Li4n0 commented Dec 14, 2021

@appleboy Is this project still being maintained?

@appleboy
Copy link
Owner

@Li4n0 Yes

@Li4n0
Copy link
Author

Li4n0 commented Mar 8, 2022

@Li4n0 Yes

So will this problem be solved? @appleboy

@fatelei
Copy link
Contributor

fatelei commented Mar 14, 2023

how about add bufsize config?

@appleboy
Copy link
Owner

fixed in #78

@appleboy appleboy added the bug label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants