Skip to content

fix HttpServer::loop idx iteration exception #726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

House-Men
Copy link
Contributor

@House-Men House-Men commented Apr 17, 2025

for (int idx = 0; ; ++idx) {
    loop = m_server.loop(idx);
    if (!loop) break;
    ....
}

类似上述迭代获取loop会在非loop线程内不会死循环,在loop线程内死循环,而多进程模式也不好计算privdata->loops内部私有数组实际数量,不同线程环境行为不一致和idx语义有歧义所以调整了超出idx最大范围时返回NULL

@House-Men House-Men changed the title HttpServer::loop idx iteration exception fix HttpServer::loop idx iteration exception Apr 17, 2025
@ithewei ithewei merged commit 05bd1ca into ithewei:master Apr 17, 2025
6 checks passed
@House-Men House-Men deleted the patch-8 branch April 17, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants