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

Changing timeout didn't help. Use PopData of zero bytes to rekey...

This issue may actually be a rekey issue, to clear this, we need
to call cryptPopData(), but we can pop zero bytes.

In this case, re-try the flush.
parent 58580a5c
No related branches found
No related tags found
No related merge requests found
......@@ -2456,16 +2456,25 @@ void output_thread(void* arg)
* afterward... presumably because the read timeout gets set to
* what the current write timeout is.
*/
if(cryptStatusError(err=cryptSetAttribute(sbbs->ssh_session, CRYPT_OPTION_NET_WRITETIMEOUT, 30)))
if(cryptStatusError(err=cryptSetAttribute(sbbs->ssh_session, CRYPT_OPTION_NET_WRITETIMEOUT, 5)))
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "setting write timeout");
if(cryptStatusError((err=cryptFlushData(sbbs->ssh_session)))) {
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "flushing data");
ssh_errors++;
if (err != CRYPT_ERROR_TIMEOUT) {
sbbs->online=FALSE;
i=buftop-bufbot; // Pretend we sent it all
do {
if(cryptStatusError((err=cryptFlushData(sbbs->ssh_session)))) {
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "flushing data");
ssh_errors++;
if (err == CRYPT_ERROR_TIMEOUT) {
(void)cryptPopData(sbbs->ssh_session, (void *)"", 0, &err);
if (cryptStatusError(err))
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "popping SSH data after timeout");
else
err = CRYPT_ERROR_TIMEOUT;
}
else {
sbbs->online=FALSE;
i=buftop-bufbot; // Pretend we sent it all
}
}
}
} while (err == CRYPT_ERROR_TIMEOUT);
// READ = WRITE TIMEOUT HACK... REMOVE WHEN FIXED
if(cryptStatusError(err=cryptSetAttribute(sbbs->ssh_session, CRYPT_OPTION_NET_WRITETIMEOUT, 0)))
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "setting write timeout");
......
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