mirror of
https://github.com/86Box/86Box.git
synced 2025-01-22 17:22:25 -05:00
net_modem.c: Make sure the CONNECT response gets through
This commit is contained in:
parent
bd6eb8e869
commit
7c9e94fb9b
1 changed files with 7 additions and 1 deletions
|
@ -112,6 +112,7 @@ typedef struct modem_t
|
|||
bool connected, ringing;
|
||||
bool echo, numericresponse;
|
||||
bool tcpIpMode, tcpIpConnInProgress;
|
||||
bool cooldown;
|
||||
bool telnet_mode;
|
||||
bool dtrstate;
|
||||
uint32_t tcpIpConnCounter;
|
||||
|
@ -369,13 +370,17 @@ host_to_modem_cb(void *priv)
|
|||
if (!((modem->serial->mctrl & 2) || modem->flowcontrol != 3))
|
||||
goto no_write_to_machine;
|
||||
|
||||
if (modem->mode == MODEM_MODE_DATA && fifo8_num_used(&modem->rx_data)) {
|
||||
if (modem->mode == MODEM_MODE_DATA && fifo8_num_used(&modem->rx_data) && !modem->cooldown) {
|
||||
serial_write_fifo(modem->serial, fifo8_pop(&modem->rx_data));
|
||||
} else if (fifo8_num_used(&modem->data_pending)) {
|
||||
uint8_t val = fifo8_pop(&modem->data_pending);
|
||||
serial_write_fifo(modem->serial, val);
|
||||
}
|
||||
|
||||
if (fifo8_num_used(&modem->data_pending) == 0) {
|
||||
modem->cooldown = false;
|
||||
}
|
||||
|
||||
no_write_to_machine:
|
||||
timer_on_auto(&modem->host_to_serial_timer, (1000000.0 / (double)modem->baudrate) * (double)9);
|
||||
}
|
||||
|
@ -524,6 +529,7 @@ modem_enter_connected_state(modem_t* modem)
|
|||
modem->ringing = false;
|
||||
modem->connected = true;
|
||||
modem->tcpIpMode = true;
|
||||
modem->cooldown = true;
|
||||
plat_netsocket_close(modem->serversocket);
|
||||
modem->serversocket = -1;
|
||||
memset(&modem->telClient, 0, sizeof(modem->telClient));
|
||||
|
|
Loading…
Reference in a new issue