google / google/CodeCity

Close telnet connections which do not log in promptly

Open
#360 3 comments 0 reactions 1 assignee Claimed by @cpcallen View on GitHub
core enhancement
Dominant language
JavaScript
Stars
198
Forks
38
PR merge metrics
No merged PRs in 30d

Description

When an inbound telnet connection is made, a timer should be started and the connection closed if no successful login has occurred within some (probably small) amount of time.

Background:

We ended up with a whole bunch of connection objects in `$.servers.telnet.connected`. Looking at their `.buffer` property, I could see that something had connected to port 7777 and spammed some random binary data, but without a newline character to trigger a call to `.onReceiveLine`. This had apparently happened ca. 1400 times.

I did an eval to call .close on these connection objects; ~700 of them were apparently still attached to open connections, and calling .close caused them to be closed and then removed from the `.connected` list by their .onClose handler. The other ~700 had `.connected` set to true but were apparently not actually connected to anything so calling `.close` did not result in their `.onClose` being called. I set their `.open = false` manually, causing them to be cleared from the list the next time an actual connection dropped.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.