Skip to content
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

step24并发http服务器无法接收http报文内容 #13

Open
HappyLuffe opened this issue Aug 22, 2024 · 1 comment
Open

step24并发http服务器无法接收http报文内容 #13

HappyLuffe opened this issue Aug 22, 2024 · 1 comment

Comments

@HappyLuffe
Copy link

问题描述:小彭老师好,在step24中,接收到http请求后,通过spawn_task函数创建一个协程处理新的连接,在s.getline()这行代码上无法得到返回,导致handle_connection后续的部分无法得到执行,浏览器也得不到回传的报文。

请问小彭老师能否修复一下这个bug,个人能力有限,尝试修复后还是无法解决。

@hxhue
Copy link

hxhue commented Feb 27, 2025

我的理解是:step24.cpp:38 创建和启动了一个临时的任务。任务如果需要阻塞就会被暂停,然后 spawn_task(...); 这条语句结束了,Task 对象被析构,被暂停的协程会被销毁。不知道这样对不对呢?

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

No branches or pull requests

2 participants