Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
0eff7f37
Commit
0eff7f37
authored
Jan 29, 2019
by
Ye Ben
Committed by
Chris O'Haver
Jan 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some typo fix (#2512)
Signed-off-by:
yeya24
<
ben.ye@daocloud.io
>
parent
a84c26d7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
8 deletions
+8
-8
plugin/errors/errors.go
plugin/errors/errors.go
+1
-1
plugin/errors/errors_test.go
plugin/errors/errors_test.go
+1
-1
request/request.go
request/request.go
+4
-4
test/compression_scrub_test.go
test/compression_scrub_test.go
+1
-1
test/metrics_test.go
test/metrics_test.go
+1
-1
No files found.
plugin/errors/errors.go
View file @
0eff7f37
...
@@ -50,7 +50,7 @@ func errorLogger(code int, qName, qType, err string) {
...
@@ -50,7 +50,7 @@ func errorLogger(code int, qName, qType, err string) {
}
}
func
consLogger
(
cnt
uint32
,
pattern
string
,
p
time
.
Duration
)
{
func
consLogger
(
cnt
uint32
,
pattern
string
,
p
time
.
Duration
)
{
log
.
Errorf
(
"%d errors like '%s' occured in last %s"
,
cnt
,
pattern
,
p
)
log
.
Errorf
(
"%d errors like '%s' occur
r
ed in last %s"
,
cnt
,
pattern
,
p
)
}
}
func
(
h
*
errorHandler
)
logPattern
(
i
int
)
{
func
(
h
*
errorHandler
)
logPattern
(
i
int
)
{
...
...
plugin/errors/errors_test.go
View file @
0eff7f37
...
@@ -78,7 +78,7 @@ func TestConsLogger(t *testing.T) {
...
@@ -78,7 +78,7 @@ func TestConsLogger(t *testing.T) {
consLogger
(
5
,
"^Error.*!$"
,
3
*
time
.
Second
)
consLogger
(
5
,
"^Error.*!$"
,
3
*
time
.
Second
)
exp
:=
"[ERROR] plugin/errors: 5 errors like '^Error.*!$' occured in last 3s"
exp
:=
"[ERROR] plugin/errors: 5 errors like '^Error.*!$' occur
r
ed in last 3s"
act
:=
buf
.
String
()
act
:=
buf
.
String
()
if
!
strings
.
Contains
(
act
,
exp
)
{
if
!
strings
.
Contains
(
act
,
exp
)
{
t
.
Errorf
(
"Unexpected log message, expected to contain %q, actual %q"
,
exp
,
act
)
t
.
Errorf
(
"Unexpected log message, expected to contain %q, actual %q"
,
exp
,
act
)
...
...
request/request.go
View file @
0eff7f37
...
@@ -299,8 +299,8 @@ func (r *Request) Scrub(reply *dns.Msg) *dns.Msg {
...
@@ -299,8 +299,8 @@ func (r *Request) Scrub(reply *dns.Msg) *dns.Msg {
// pretty rare. Normally, the loop will exit when l > re, meaning that
// pretty rare. Normally, the loop will exit when l > re, meaning that
// in the previous iteration either:
// in the previous iteration either:
// rl < size: no need to do anything.
// rl < size: no need to do anything.
// rl > size: the final size is too large, and if m > 0, the prece
e
ding
// rl > size: the final size is too large, and if m > 0, the preceding
// iteration the size was too small. Select that prece
e
ding size.
// iteration the size was too small. Select that preceding size.
if
rl
>
size
&&
m
>
0
{
if
rl
>
size
&&
m
>
0
{
reply
.
Extra
=
origExtra
[
:
m
-
1
]
reply
.
Extra
=
origExtra
[
:
m
-
1
]
rl
=
reply
.
Len
()
rl
=
reply
.
Len
()
...
@@ -334,8 +334,8 @@ func (r *Request) Scrub(reply *dns.Msg) *dns.Msg {
...
@@ -334,8 +334,8 @@ func (r *Request) Scrub(reply *dns.Msg) *dns.Msg {
// pretty rare. Normally, the loop will exit when l > ra, meaning that
// pretty rare. Normally, the loop will exit when l > ra, meaning that
// in the previous iteration either:
// in the previous iteration either:
// rl < size: no need to do anything.
// rl < size: no need to do anything.
// rl > size: the final size is too large, and if m > 0, the prece
e
ding
// rl > size: the final size is too large, and if m > 0, the preceding
// iteration the size was too small. Select that prece
e
ding size.
// iteration the size was too small. Select that preceding size.
if
rl
>
size
&&
m
>
0
{
if
rl
>
size
&&
m
>
0
{
reply
.
Answer
=
origAnswer
[
:
m
-
1
]
reply
.
Answer
=
origAnswer
[
:
m
-
1
]
// No need to recalc length, as we don't use it. We set truncated anyway. Doing
// No need to recalc length, as we don't use it. We set truncated anyway. Doing
...
...
test/compression_scrub_test.go
View file @
0eff7f37
...
@@ -42,7 +42,7 @@ func TestCompressScrub(t *testing.T) {
...
@@ -42,7 +42,7 @@ func TestCompressScrub(t *testing.T) {
}
}
buf
=
buf
[
:
n
]
buf
=
buf
[
:
n
]
// If there is compression in the returned packet we should look for compression pointers, if found
// If there is compression in the returned packet we should look for compression pointers, if found
// the pointers should return to the domain name in the query (the first domain name that's avaiable for
// the pointers should return to the domain name in the query (the first domain name that's avai
l
able for
// compression. This means we're looking for a combo where the pointers is detected and the offset is 12
// compression. This means we're looking for a combo where the pointers is detected and the offset is 12
// the position of the first name after the header. The erratic plugin adds 30 RRs that should all be compressed.
// the position of the first name after the header. The erratic plugin adds 30 RRs that should all be compressed.
found
:=
0
found
:=
0
...
...
test/metrics_test.go
View file @
0eff7f37
...
@@ -161,7 +161,7 @@ google.com:0 {
...
@@ -161,7 +161,7 @@ google.com:0 {
}
}
defer
i
.
Stop
()
defer
i
.
Stop
()
// send an inital query to setup properly the cache size
// send an init
i
al query to setup properly the cache size
m
:=
new
(
dns
.
Msg
)
m
:=
new
(
dns
.
Msg
)
m
.
SetQuestion
(
"google.com."
,
dns
.
TypeA
)
m
.
SetQuestion
(
"google.com."
,
dns
.
TypeA
)
if
_
,
err
=
dns
.
Exchange
(
m
,
udp
);
err
!=
nil
{
if
_
,
err
=
dns
.
Exchange
(
m
,
udp
);
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment