windows driver now operational, linux driver broken

This commit is contained in:
2022-01-12 17:23:02 -05:00
parent 089b8e15c7
commit fbe2120bb3
2 changed files with 28 additions and 4 deletions

View File

@@ -380,12 +380,14 @@ public:
struct pollfd &pfd = pollvec[index++];
pfd.fd = p.second;
pfd.events = POLLIN;
pfd.revents = 0;
}
for (const ChanInfo &chan : chans_) {
struct pollfd &pfd = pollvec[index++];
assert(chan.socket != INVALID_SOCKET);
pfd.fd = chan.socket;
pfd.events = POLLERR;
pfd.events = 0;
pfd.revents = 0;
if (chan.ready_now) mstimeout = 0;
if (chan.just_released) mstimeout = 0;
if (chan.ready_on_pollin) pfd.events |= POLLIN;
@@ -413,7 +415,7 @@ public:
struct pollfd &pfd = pollvec[index++];
bool pollin = ((pfd.revents & POLLIN) != 0);
bool pollout = ((pfd.revents & POLLOUT) != 0);
bool pollerr = ((pfd.revents & POLLERR) != 0);
bool pollerr = ((pfd.revents & (POLLERR | POLLHUP)) != 0);
if (chan.ready_now || pollerr || chan.just_released ||
(chan.ready_on_pollin && pollin) ||
(chan.ready_on_pollout && pollout) ||
@@ -433,6 +435,7 @@ public:
}
void drive(DrivenEngine *de, int argc, char *argv[]) {
socket_init();
SSL_load_error_strings();
ERR_load_crypto_strings();
enable_tty_raw();
@@ -476,6 +479,7 @@ public:
SSL_CTX_free(ssl_ctx_with_root_certs_);
SSL_CTX_free(ssl_ctx_with_server_certs_);
DrivenEngine::set(nullptr);
socket_uninit();
}
};