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

Make header constants compatible with Ractors #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/net/dns/header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ class RCode
# Constant for +rcode+ Response Code Refused Error
REFUSED = 5

RCodeType = %w[NoError FormErr ServFail NXDomain NotImp
Refused YXDomain YXRRSet NXRRSet NotAuth NotZone].freeze
RCodeType = Ractor.make_shareable(%w[NoError FormErr ServFail NXDomain NotImp
Refused YXDomain YXRRSet NXRRSet NotAuth NotZone].freeze)

RCodeErrorString = ["No errors",
RCodeErrorString = Ractor.make_shareable(["No errors",
"The name server was unable to interpret the query",
"The name server was unable to process this query due to problem with the name server",
"Domain name referenced in the query does not exists",
Expand All @@ -126,7 +126,7 @@ class RCode
"",
"",
"",
"",].freeze
"",].freeze)

attr_reader :code
attr_reader :type
Expand All @@ -152,7 +152,7 @@ def to_s
# Constant for +opCode+ status
STATUS = 2
# Array with given strings
OPARR = %w[QUERY IQUERY STATUS].freeze
OPARR = Ractor.make_shareable(%w[QUERY IQUERY STATUS].freeze)

# Reader for +id+ attribute
attr_reader :id
Expand Down