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

我发现co_hook_sys_call.cpp里面对connect的hook没有使用poll去等待异步结果,导致一些第三方库connect时失败 #13

Closed
dreamcreated opened this issue Dec 22, 2016 · 7 comments

Comments

@dreamcreated
Copy link

因为很多第三方库(比如hiredis或者mysql c driver) 创建连接时使用的是同步connect的函数, 接入libco后,mysql c driver 调用 mysql_real_connect 会返回115错误,调试发现当调用到hook的connect函数后,直接返回ret -1, errno为115。
我觉得这里是不是应该模拟同步connect时的ret, 即发起连接请求后立即调用co_poll yield出去,等待connect成功后再回到这里返回正确的ret。
现在的实现导致mysql c driver无法正确连接成功。

@dreamcreated dreamcreated changed the title 我发现co_hook_sys_call.cpp里面对connect的hook没有使用poll去等待异步结果 我发现co_hook_sys_call.cpp里面对connect的hook没有使用poll去等待异步结果,导致一些第三方库connect时失败 Dec 22, 2016
@dreamcreated
Copy link
Author

刚看了一下发现十几天前已经更新这里的代码了。我用新代码再试一下。

@dreamcreated
Copy link
Author

tencent-wechat的那个git 库的connect代码是错的。。。

@leiffyli
Copy link
Collaborator

嗯?tencent-wechat的代码和这边是一起同步的,能具体描述下问题么?

@dreamcreated
Copy link
Author

@leiffyli 你对比一下 tencent-wechat的 co_hook_sys_call.cpp 里面的connect函数就知道啦

@leiffyli
Copy link
Collaborator

@zhubenwuzui 额,我这边看到的是一致的呀,你再看下是否是最新的

@dreamcreated
Copy link
Author

@leiffyli 难道是中午没睡觉产生幻觉了。。。
应该是之前我本地库没有git pull吧。总之现在两边都对了。
多谢回复!

@leiffyli
Copy link
Collaborator

@zhubenwuzui ok,欢迎继续交流:)

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