Merge pull request #260 from BeyondWUXF/hotfix/BeyondWUXF/queue_mode_fd

修复QueueMode模式下fd=-1导致进错队列
This commit is contained in:
ruanshudong 2022-10-26 18:21:21 +08:00 committed by GitHub
commit c62ad191a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,14 +75,14 @@ void TC_EpollServer::DataBuffer::insertRecvQueue(const shared_ptr<RecvContext> &
{
++_iRecvBufferSize;
getDataQueue(recv->fd())->push_back(recv);
getDataQueue(recv->uid())->push_back(recv);
if(_schedulers[0] != NULL)
{
//存在调度器, 处于协程中
if(isQueueMode())
{
_schedulers[index(recv->fd())]->notify();
_schedulers[index(recv->uid())]->notify();
}
else
{
@ -100,14 +100,14 @@ void TC_EpollServer::DataBuffer::insertRecvQueue(const deque<shared_ptr<RecvCont
_iRecvBufferSize += recv.size();
getDataQueue(recv.back()->fd())->push_back(recv);
getDataQueue(recv.back()->uid())->push_back(recv);
if (_schedulers[0] != NULL)
{
//存在调度器, 处于协程中
if (isQueueMode())
{
_schedulers[index(recv.back()->fd())]->notify();
_schedulers[index(recv.back()->uid())]->notify();
}
else
{