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

Fixes #1328 esc in telnet #1335

Merged
merged 3 commits into from
Dec 31, 2015

Conversation

Dunbaratu
Copy link
Member

The problem was caused by the code presuming every time there
was an ESC that there MUST be another character following it
that it can read ahead on the next index. When there wasn't
yet and the snippet of input chars just ended at the ESC, the
attempt to go one more character forward threw an array bounds
exception. This was never sent to the output_log, however
because the telnet server runs in a separate thread and
apparently the output_log only contains the main thread's output.

When the telnet server thread died from the exception, the telnet
client doesn't show anything about it, other than just freezing
for several seconds and then eventually reporting a dropped
connection.

The problem was caused by the code presuming every time there
was an ESC that there MUST be another character following it
that it can read ahead on the next index.  When there wasn't
yet and the snippet of input chars just ended at the ESC, the
attempt to go one more character forward threw an array bounds
exception.  This was never sent to the output_log, however
because the telnet server runs in a separate thread and
apparently the output_log only contains the main thread's output.

When the telnet server thread died from the exception, the telnet
client doesn't show anything about it, other than just freezing
for several seconds and then eventually reporting a dropped
connection.
erendrake added a commit that referenced this pull request Dec 31, 2015
@erendrake erendrake merged commit 87ec1e7 into KSP-KOS:develop Dec 31, 2015
@Dunbaratu Dunbaratu added the bug Weird outcome is probably not what the mod programmer expected. label Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Weird outcome is probably not what the mod programmer expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants