Skip to content

Catch writes interrupted by exit. - #43

Open
QuzarDC wants to merge 1 commit into
masterfrom
early_exit_fix
Open

Catch writes interrupted by exit.#43
QuzarDC wants to merge 1 commit into
masterfrom
early_exit_fix

Conversation

@QuzarDC

@QuzarDC QuzarDC commented Aug 12, 2026

Copy link
Copy Markdown
Member

The code for recv_data was presuming that the syscall on the DC side would continue until the data was finished. In the event of the program exiting though, if a data transfer was still in progress this would cause a somewhat cryptic "Obviously bad packet" error and dc-tool waiting for further commands that would never be received.

Now, on each packet receive we test for the possibility that a CMD_EXIT was received and if so percolate up an exit code.

The code for `recv_data` was presuming that the syscall on the DC
side would continue until the data was finished. In the event of the
program exiting though, if a data transfer was still in progress this
would cause a somewhat cryptic "Obviously bad packet" error and dc-tool
waiting for further commands that would never be received.

Now, on each packet receive we test for the possibility that a CMD_EXIT
was received and if so percolate up an exit code.
@QuzarDC QuzarDC added the bug Something isn't working label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant