Fix RCON socket lifetime after authentication #3

Closed
opened 2026-10-16 04:39:21 +02:00 by rexlManu · 0 comments
Owner

The legacy RCON listener authenticated a connection, then closed its socket before accepting a command. The cleanup block was inside the request loop.

The maintained source now keeps the socket and buffered input stream for the full connection. It reads complete length-prefixed TCP frames, validates lengths and terminators, and sends UTF-8 responses without splitting a character. The shared thread base publishes its running state before starting the thread.

  • Restore the intended socket lifetime without editing the frozen MCP archive.
  • Verify authenticate-then-command behavior on a real local server connection without adding test code.
  • Verify normal disconnect and server shutdown cleanup.

Verified on the rebuilt full dedicated pack under Java 8 in run/maintenance-check/server, bound to loopback. The server loaded 75 FML containers. Fragmented authentication, two coalesced commands, failed authentication followed by successful authentication, unauthenticated command rejection, invalid length and terminator rejection, normal disconnect/reconnect, save-all, and RCON stop all passed. A 4,109-byte UTF-8 response was returned as valid 4,096-byte and 13-byte payloads and reconstructed without loss; the following command on the same socket passed. The connection reached EOF on shutdown and Gradle exited successfully.

Server log: /tmp/tekkitlite-maintenance-rcon-server.log. No test code added. No player worlds or active integration runs were changed. The legacy import skip list preserves both maintained RCON files. Included in maintenance audit #28.

The legacy RCON listener authenticated a connection, then closed its socket before accepting a command. The cleanup block was inside the request loop. The maintained source now keeps the socket and buffered input stream for the full connection. It reads complete length-prefixed TCP frames, validates lengths and terminators, and sends UTF-8 responses without splitting a character. The shared thread base publishes its running state before starting the thread. - [x] Restore the intended socket lifetime without editing the frozen MCP archive. - [x] Verify authenticate-then-command behavior on a real local server connection without adding test code. - [x] Verify normal disconnect and server shutdown cleanup. Verified on the rebuilt full dedicated pack under Java 8 in `run/maintenance-check/server`, bound to loopback. The server loaded 75 FML containers. Fragmented authentication, two coalesced commands, failed authentication followed by successful authentication, unauthenticated command rejection, invalid length and terminator rejection, normal disconnect/reconnect, save-all, and RCON stop all passed. A 4,109-byte UTF-8 response was returned as valid 4,096-byte and 13-byte payloads and reconstructed without loss; the following command on the same socket passed. The connection reached EOF on shutdown and Gradle exited successfully. Server log: `/tmp/tekkitlite-maintenance-rcon-server.log`. No test code added. No player worlds or active integration runs were changed. The legacy import skip list preserves both maintained RCON files. Included in maintenance audit #28.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rexlManu/TekkitLite#3
No description provided.