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

HTTPS服务器回调函数问题 #465

Closed
hnustxiaoj opened this issue Nov 20, 2023 · 2 comments
Closed

HTTPS服务器回调函数问题 #465

hnustxiaoj opened this issue Nov 20, 2023 · 2 comments

Comments

@hnustxiaoj
Copy link

请问一下,http_server_t结构体的userdata成员变量如何使用。
我想在HttpServer的run函数前设置好userdata,在回调函数内部获取、使用提前设置好的userdata

@ithewei
Copy link
Owner

ithewei commented Nov 22, 2023

在回调函数内部无法直接获取到HttpServer,只能自己使用全局变量保存下或者回调函数参数列表里捕获下

@hnustxiaoj
Copy link
Author

好的,我自己稍微修改了下源码,在回调之前,将HttpServer的部分参数传递给HttpRequestPtr

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