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

Move ssh_complete out of ssh_mutex

Coverity seems to hate it mostly in the mutex, so change it to
mostly outside of the mutex and see if that's fine.

It doesn't really matter where it's changed as it's an atomic bool.
parent caa48db0
Branches
Tags
1 merge request!488Overhaul LZH code
Pipeline #7549 passed
...@@ -173,8 +173,8 @@ ssh_input_thread(void *args) ...@@ -173,8 +173,8 @@ ssh_input_thread(void *args)
sftp_do_finish = false; sftp_do_finish = false;
pthread_mutex_lock(&ssh_mutex); pthread_mutex_lock(&ssh_mutex);
if (FlushData(ssh_session) == CRYPT_ERROR_COMPLETE) { if (FlushData(ssh_session) == CRYPT_ERROR_COMPLETE) {
ssh_complete = true;
pthread_mutex_unlock(&ssh_mutex); pthread_mutex_unlock(&ssh_mutex);
ssh_complete = true;
break; break;
} }
if (ssh_channel != -1) { if (ssh_channel != -1) {
...@@ -189,10 +189,10 @@ ssh_input_thread(void *args) ...@@ -189,10 +189,10 @@ ssh_input_thread(void *args)
} }
if (ssh_channel == -1 && sftp_channel == -1) { if (ssh_channel == -1 && sftp_channel == -1) {
both_gone = true; both_gone = true;
ssh_complete = true;
} }
pthread_mutex_unlock(&ssh_mutex); pthread_mutex_unlock(&ssh_mutex);
if (both_gone) { if (both_gone) {
ssh_complete = true;
break; break;
} }
if (sftp_do_finish) { if (sftp_do_finish) {
...@@ -204,8 +204,8 @@ ssh_input_thread(void *args) ...@@ -204,8 +204,8 @@ ssh_input_thread(void *args)
pthread_mutex_lock(&ssh_mutex); pthread_mutex_lock(&ssh_mutex);
if (FlushData(ssh_session) == CRYPT_ERROR_COMPLETE) { if (FlushData(ssh_session) == CRYPT_ERROR_COMPLETE) {
ssh_complete = true;
pthread_mutex_unlock(&ssh_mutex); pthread_mutex_unlock(&ssh_mutex);
ssh_complete = true;
break; break;
} }
...@@ -223,8 +223,8 @@ ssh_input_thread(void *args) ...@@ -223,8 +223,8 @@ ssh_input_thread(void *args)
} }
} }
if (ssh_channel == -1 && sftp_channel == -1) { if (ssh_channel == -1 && sftp_channel == -1) {
ssh_complete = true;
pthread_mutex_unlock(&ssh_mutex); pthread_mutex_unlock(&ssh_mutex);
ssh_complete = true;
break; break;
} }
...@@ -332,8 +332,8 @@ ssh_output_thread(void *args) ...@@ -332,8 +332,8 @@ ssh_output_thread(void *args)
ret = 0; ret = 0;
pthread_mutex_lock(&ssh_mutex); pthread_mutex_lock(&ssh_mutex);
if (ssh_channel == -1) { if (ssh_channel == -1) {
ssh_complete = true;
pthread_mutex_unlock(&ssh_mutex); pthread_mutex_unlock(&ssh_mutex);
ssh_complete = true;
channel_gone = true; channel_gone = true;
break; break;
} }
...@@ -345,8 +345,8 @@ ssh_output_thread(void *args) ...@@ -345,8 +345,8 @@ ssh_output_thread(void *args)
FlushData(ssh_session); FlushData(ssh_session);
} }
if (cryptStatusError(status)) { if (cryptStatusError(status)) {
ssh_complete = true;
pthread_mutex_unlock(&ssh_mutex); pthread_mutex_unlock(&ssh_mutex);
ssh_complete = true;
if ((status == CRYPT_ERROR_COMPLETE) || (status == CRYPT_ERROR_NOTFOUND)) { /* connection closed */ if ((status == CRYPT_ERROR_COMPLETE) || (status == CRYPT_ERROR_NOTFOUND)) { /* connection closed */
channel_gone = true; channel_gone = true;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment