Skip to content
Snippets Groups Projects
Commit 741ea1f9 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 05bb17d5
No related branches found
No related tags found
No related merge requests found
......@@ -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.
Finish editing this message first!
Please register or to comment