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

confused method name [to_little_endian] #36

Closed
lparam opened this issue Sep 10, 2013 · 4 comments
Closed

confused method name [to_little_endian] #36

lparam opened this issue Sep 10, 2013 · 4 comments

Comments

@lparam
Copy link

lparam commented Sep 10, 2013

lua-mongo.c 里的to_little_endian方法写错了.
return u.b[0] | u.b[1] << 8 | u.b[2] << 16 | u.b[3] << 24;
==>
return u.b[3] | u.b[2] << 8 | u.b[1] << 16 | u.b[0] << 24;

@cloudwu
Copy link
Owner

cloudwu commented Sep 10, 2013

你确定写错了?还是函数名没起好?

这个 driver 是可以工作的呀, 如果这个反了, 就不能正常工作了.

@cloudwu
Copy link
Owner

cloudwu commented Sep 10, 2013

mongo 协议规定是用 little endian 的

@cloudwu cloudwu closed this as completed Sep 10, 2013
@lparam
Copy link
Author

lparam commented Sep 10, 2013

我并没有用这个driver,只是浏览代码.
to_little_endian这个方法难道不是big endian to little endian的意思么?

@lparam
Copy link
Author

lparam commented Sep 10, 2013

看了MongoDB Wire Protocol,确实只是函数名没起好.

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