Merge pull request #207 from dengjunplusplus/windows-dev

fix windows crash bug and mysql_cli bug
This commit is contained in:
xiehan
2021-01-11 14:37:50 +08:00
committed by GitHub
2 changed files with 9 additions and 2 deletions
+4 -2
View File
@@ -1051,7 +1051,7 @@ void Communicator::handle_incoming_idle(struct poller_result *res)
ReadContext *ctx = (ReadContext *)res->data.context;
CommConnEntry *entry = (CommConnEntry *)ctx->entry;
CommTarget *target = entry->target;
CommSession *session = entry->session;
CommSession *session = NULL;
int cs_state;
target->mutex.lock();
@@ -1060,6 +1060,8 @@ void Communicator::handle_incoming_idle(struct poller_result *res)
list_del(&entry->list);
entry->state = CONN_STATE_FREE;
}
else
session = entry->session;
target->mutex.unlock();
@@ -1221,6 +1223,7 @@ void Communicator::handle_request_result(struct poller_result *res)
switch (res->state)
{
case PR_ST_SUCCESS:
case PR_ST_FINISHED:
do
{
if (nleft >= buffer->len)
@@ -1291,7 +1294,6 @@ void Communicator::handle_request_result(struct poller_result *res)
break;
case PR_ST_FINISHED:
case PR_ST_ERROR:
case PR_ST_TIMEOUT:
cs_state = CS_STATE_ERROR;
+5
View File
@@ -488,6 +488,11 @@ int WinPoller::get_io_result(struct poller_result *res, int timeout)
res->state = PR_ST_ERROR;
res->error = ENOENT;
}
else if (bytes_transferred == 0)
{
res->state = PR_ST_FINISHED;
res->error = ECONNRESET;
}
else
{
res->state = PR_ST_SUCCESS;