Skip to content

Commit

Permalink
Typo Fixed & Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
636f7374 committed Mar 9, 2020
1 parent 0a6b82a commit 73a3fa5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/chaos_class_resolve.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#query local bind server version using CH class, TXT record
# Query local bind server version using CH class, TXT record

require "../src/durian.cr"

Expand Down
14 changes: 7 additions & 7 deletions src/durian/packet/request.cr
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module Durian::Packet
end
{% end %}

private def self.parse_flags_with_count!(request : Request, io, buffer : IO)
private def self.parse_flags_count!(request : Request, io, buffer : IO)
static_bits = ByteFormat.extract_uint16_bits io, buffer
bits_io = IO::Memory.new static_bits.to_slice

Expand Down Expand Up @@ -95,7 +95,7 @@ module Durian::Packet
end

request.transId = trans_id
parse_flags_with_count! request, io, buffer
parse_flags_count! request, io, buffer

request.questionCount.times do
break if bad_decode
Expand Down Expand Up @@ -145,25 +145,25 @@ module Durian::Packet
flags = String.bits_build do |io|
# QR : 1 bit, request (0) or response (1)
# Request not required, set to 1 Zero
io << QRFlag::Query.to_i.to_s
io << QRFlag::Query.to_i

# OpCode : 4 bits, request type
# |_ QUERY_ Standard request
# |_ IQUERY Inverse request (obsoleted by RFC3425)
# |_ STATUS Server status query
# |_ NOTIFY Database update notification (RFC1996)
# |_ UPDATE Dynamic database update (RFC2136)
io << "%04b" % operationCode.to_i.to_s
io << "%04b" % operationCode.to_i

# AA Authoritative Answer : 1 bit, reply from authoritative (1) or from cache (0)
# Request not required, set to 1 Zero
io << "0"

# TC Truncated : 1 bit, response too large for UDP (1).
io << truncated.to_i.to_s
io << truncated.to_i

# RD Recursion Desired: 1bit, ask for recursive (1) or iterative (0) response
io << recursionDesired.to_i.to_s
io << recursionDesired.to_i

# RA Recursion Available : 1bit, server manages recursive (1) or not (0)
# Request not required, set to 1 Zero
Expand All @@ -174,7 +174,7 @@ module Durian::Packet
io << "0"

# 1 bit AD Authenticated data, used by DNSSEC
io << authenticatedData.to_i.to_s
io << authenticatedData.to_i

# 1 bit CD Checking Disabled, used by DNSSEC
# Request not required, set to 1 Zero
Expand Down
4 changes: 2 additions & 2 deletions src/durian/packet/response.cr
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module Durian::Packet
@random = Random.new
end

private def self.parse_flags_with_count!(response : Response, io, buffer : IO)
private def self.parse_flags_count!(response : Response, io, buffer : IO)
static_bits = ByteFormat.extract_uint16_bits io, buffer
bits_io = IO::Memory.new static_bits.to_slice

Expand Down Expand Up @@ -101,7 +101,7 @@ module Durian::Packet
end

response.transId = trans_id
parse_flags_with_count! response, io, buffer
parse_flags_count! response, io, buffer

response.questionCount.times do
break if bad_decode
Expand Down

0 comments on commit 73a3fa5

Please sign in to comment.