Skip to content
Snippets Groups Projects
Commit 42fd98a1 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Set telnets_active to false on error, not true.

This way, when an error occurs, it will at least terminate the
session instead of requiring you to disconnect yourself.

This partially addresses issue 174, assuming it's actually telnets.
parent 0061b6c4
Branches
Tags
1 merge request!488Overhaul LZH code
Pipeline #7477 passed
......@@ -42,12 +42,15 @@ telnets_input_thread(void *args)
continue;
if (cryptStatusError(status)) {
if ((status == CRYPT_ERROR_COMPLETE) || (status == CRYPT_ERROR_READ)) { /* connection closed */
telnets_active = true;
pthread_mutex_lock(&telnets_mutex);
telnets_active = false;
pthread_mutex_unlock(&telnets_mutex);
break;
}
cryptlib_error_message(status, "recieving data");
telnets_active = true;
pthread_mutex_lock(&telnets_mutex);
telnets_active = false;
pthread_mutex_unlock(&telnets_mutex);
break;
}
else {
......@@ -84,11 +87,15 @@ telnets_output_thread(void *args)
pthread_mutex_unlock(&telnets_mutex);
if (cryptStatusError(status)) {
if (status == CRYPT_ERROR_COMPLETE) { /* connection closed */
telnets_active = true;
pthread_mutex_lock(&telnets_mutex);
telnets_active = false;
pthread_mutex_unlock(&telnets_mutex);
break;
}
cryptlib_error_message(status, "sending data");
telnets_active = true;
pthread_mutex_lock(&telnets_mutex);
telnets_active = false;
pthread_mutex_unlock(&telnets_mutex);
break;
}
sent += ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment