mirror of
https://github.com/sogou/workflow.git
synced 2026-10-21 22:56:42 +08:00
Merge pull request #207 from dengjunplusplus/windows-dev
fix windows crash bug and mysql_cli bug
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user