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
45c43554
Commit
45c43554
authored
Dec 06, 2019
by
Zou Nengren
Committed by
Miek Gieben
Dec 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make Prot to method (#3500)
Signed-off-by:
zouyee
<
zounengren@cmss.chinamobile.com
>
parent
13fca023
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
request/request.go
request/request.go
+3
-7
No files found.
request/request.go
View file @
45c43554
...
@@ -111,15 +111,11 @@ func (r *Request) RemoteAddr() string { return r.W.RemoteAddr().String() }
...
@@ -111,15 +111,11 @@ func (r *Request) RemoteAddr() string { return r.W.RemoteAddr().String() }
func
(
r
*
Request
)
LocalAddr
()
string
{
return
r
.
W
.
LocalAddr
()
.
String
()
}
func
(
r
*
Request
)
LocalAddr
()
string
{
return
r
.
W
.
LocalAddr
()
.
String
()
}
// Proto gets the protocol used as the transport. This will be udp or tcp.
// Proto gets the protocol used as the transport. This will be udp or tcp.
func
(
r
*
Request
)
Proto
()
string
{
return
Proto
(
r
.
W
)
}
func
(
r
*
Request
)
Proto
()
string
{
if
_
,
ok
:=
r
.
W
.
RemoteAddr
()
.
(
*
net
.
UDPAddr
);
ok
{
// Proto gets the protocol used as the transport. This will be udp or tcp.
func
Proto
(
w
dns
.
ResponseWriter
)
string
{
// FIXME(miek): why not a method on Request
if
_
,
ok
:=
w
.
RemoteAddr
()
.
(
*
net
.
UDPAddr
);
ok
{
return
"udp"
return
"udp"
}
}
if
_
,
ok
:=
w
.
RemoteAddr
()
.
(
*
net
.
TCPAddr
);
ok
{
if
_
,
ok
:=
r
.
W
.
RemoteAddr
()
.
(
*
net
.
TCPAddr
);
ok
{
return
"tcp"
return
"tcp"
}
}
return
"udp"
return
"udp"
...
...
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