-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
add setting unicast bit #96
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #96 +/- ##
==========================================
+ Coverage 97.99% 98.00% +0.01%
==========================================
Files 6 6
Lines 2046 2057 +11
==========================================
+ Hits 2005 2016 +11
Misses 41 41
|
See #94 (comment) |
ab17088
to
eaafaac
Compare
@silverwind thx for your reviewing. I modify it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So thankful
} else { | ||
q.class = classes.toString(classValue) | ||
} | ||
|
||
offset += 2 | ||
|
||
const qu = !!(q.class & QU_MASK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this section is still problematic (and there doesn't seem to be a test for decoding a question with the QU bit set) - if the bit is set, then we end up attempting a bitwise AND operation on the q.class string value (in line 1648 just below), which wipes out the string value (the result is 0).
Thank you very much for this effort - would you mind also adding a test for the decode function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly, this change was quite some time ago. I recall this PR request occurred in 2018 or 2019. This weekend, I will take a look and make some adjustments.
@@ -1608,8 +1608,12 @@ question.encode = function (q, buf, offset) { | |||
|
|||
buf.writeUInt16BE(types.toType(q.type), offset) | |||
offset += 2 | |||
if (q.qu === undefined || q.qu !== true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check does not make sense
Description:
for the unicast bit issue
I just rebase to the latest. previous pr: #49
related issues
#21