Skip to content

Conversation

thayama
Copy link

@thayama thayama commented Dec 6, 2018

Goroutines created in connect, transfer data from a handler to telnet
client. However, as there's no synchronization between the goroutine
and the telnet server, there's a case where the server sends a prompt
before the goroutines finished all transmissions.

This fix assure that the telnet server waits until all data are sent to
the client, before sending a prompt.

@thayama
Copy link
Author

thayama commented Dec 6, 2018

I've found an issue that the one last byte generated by telsh.Handler is sent after the shell prompt.
Currently, there is a race condition between handler.Run() and go func launched in connect().

I've added channels to wait for go funcs launched in connect() to finish their jobs.

Goroutines created in connect, transfer data from a handler to telnet
client. However, as there's no synchronization between the goroutines
and the telnet server, there's a case where the server sends a prompt
before the goroutines finishsed all transmissions.

This fix assure that the telnet server waits until all data are sent to
the client, before sending a prompt.
@mligor
Copy link

mligor commented Jan 5, 2021

My vote for this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants