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

More modem fixes... still doesn't properly detect remote disconnections.

parent 323992d1
Branches
Tags
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "conn.h" #include "conn.h"
#include "uifcinit.h" #include "uifcinit.h"
static COM_HANDLE com=INVALID_SOCKET; static COM_HANDLE com=COM_HANDLE_INVALID;
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma argsused #pragma argsused
...@@ -26,10 +26,6 @@ void modem_input_thread(void *args) ...@@ -26,10 +26,6 @@ void modem_input_thread(void *args)
conn_api.input_thread_running=1; conn_api.input_thread_running=1;
while(com != COM_HANDLE_INVALID && !conn_api.terminate) { while(com != COM_HANDLE_INVALID && !conn_api.terminate) {
rd=comReadBuf(com, conn_api.rd_buf, conn_api.rd_buf_size, NULL, 100); rd=comReadBuf(com, conn_api.rd_buf, conn_api.rd_buf_size, NULL, 100);
if(rd <= 0) {
if(comGetModemStatus(com)&COM_DCD == 0)
break;
}
buffered=0; buffered=0;
while(buffered < rd) { while(buffered < rd) {
pthread_mutex_lock(&(conn_inbuf.mutex)); pthread_mutex_lock(&(conn_inbuf.mutex));
...@@ -37,6 +33,8 @@ void modem_input_thread(void *args) ...@@ -37,6 +33,8 @@ void modem_input_thread(void *args)
buffered+=conn_buf_put(&conn_inbuf, conn_api.rd_buf+buffered, buffer); buffered+=conn_buf_put(&conn_inbuf, conn_api.rd_buf+buffered, buffer);
pthread_mutex_unlock(&(conn_inbuf.mutex)); pthread_mutex_unlock(&(conn_inbuf.mutex));
} }
if(comGetModemStatus(com)&COM_DCD == 0)
break;
} }
conn_api.input_thread_running=0; conn_api.input_thread_running=0;
} }
...@@ -176,7 +174,7 @@ int modem_connect(struct bbslist *bbs) ...@@ -176,7 +174,7 @@ int modem_connect(struct bbslist *bbs)
conn_api.terminate=-1; conn_api.terminate=-1;
return(-1); return(-1);
} }
if(strstr(respbuf, "ATA")) /* Dial command echoed */ if(strstr(respbuf, bbs->addr)) /* Dial command echoed */
continue; continue;
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment