google / google/CodeCity

Close telnet connections which do not log in promptly

Offen
#360 3 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @cpcallen Auf GitHub ansehen
core enhancement
Vorherrschende Sprache
JavaScript
Sterne
198
Forks
38
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.