Skip to content
Snippets Groups Projects
Commit fd15c463 authored by deuce's avatar deuce
Browse files

Handle locking the same as other output methods.

parent 6d01013e
No related branches found
No related tags found
No related merge requests found
...@@ -97,9 +97,7 @@ void ssh_output_thread(void *args) ...@@ -97,9 +97,7 @@ void ssh_output_thread(void *args)
while(ssh_active && !conn_api.terminate) { while(ssh_active && !conn_api.terminate) {
pthread_mutex_lock(&(conn_outbuf.mutex)); pthread_mutex_lock(&(conn_outbuf.mutex));
wr=conn_buf_wait_bytes(&conn_outbuf, 1, 100); wr=conn_buf_wait_bytes(&conn_outbuf, 1, 100);
pthread_mutex_unlock(&(conn_outbuf.mutex));
if(wr) { if(wr) {
pthread_mutex_lock(&(conn_outbuf.mutex));
wr=conn_buf_get(&conn_outbuf, conn_api.wr_buf, conn_api.wr_buf_size); wr=conn_buf_get(&conn_outbuf, conn_api.wr_buf, conn_api.wr_buf_size);
pthread_mutex_unlock(&(conn_outbuf.mutex)); pthread_mutex_unlock(&(conn_outbuf.mutex));
sent=0; sent=0;
...@@ -118,6 +116,8 @@ void ssh_output_thread(void *args) ...@@ -118,6 +116,8 @@ void ssh_output_thread(void *args)
if(sent) if(sent)
cl.FlushData(ssh_session); cl.FlushData(ssh_session);
} }
else
pthread_mutex_unlock(&(conn_outbuf.mutex));
} }
conn_api.output_thread_running=0; conn_api.output_thread_running=0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment