Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
11ace8e9
Commit
11ace8e9
authored
Nov 05, 2010
by
Wei Guangjing
Committed by
Russ Cox
Nov 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: fix windows build
R=rsc CC=golang-dev
https://golang.org/cl/2932041
parent
3b44fbe8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
src/pkg/net/dnsname_test.go
src/pkg/net/dnsname_test.go
+4
-0
src/pkg/net/resolv_windows.go
src/pkg/net/resolv_windows.go
+7
-2
No files found.
src/pkg/net/dnsname_test.go
View file @
11ace8e9
...
@@ -6,6 +6,7 @@ package net
...
@@ -6,6 +6,7 @@ package net
import
(
import
(
"testing"
"testing"
"runtime"
)
)
type
testCase
struct
{
type
testCase
struct
{
...
@@ -54,6 +55,9 @@ func getTestCases(ch chan<- *testCase) {
...
@@ -54,6 +55,9 @@ func getTestCases(ch chan<- *testCase) {
}
}
func
TestDNSNames
(
t
*
testing
.
T
)
{
func
TestDNSNames
(
t
*
testing
.
T
)
{
if
runtime
.
GOOS
==
"windows"
{
return
}
ch
:=
make
(
chan
*
testCase
)
ch
:=
make
(
chan
*
testCase
)
go
getTestCases
(
ch
)
go
getTestCases
(
ch
)
for
tc
:=
range
ch
{
for
tc
:=
range
ch
{
...
...
src/pkg/net/resolv_windows.go
View file @
11ace8e9
...
@@ -43,9 +43,10 @@ type SRV struct {
...
@@ -43,9 +43,10 @@ type SRV struct {
Weight
uint16
Weight
uint16
}
}
func
LookupSRV
(
name
string
)
(
cname
string
,
addrs
[]
*
SRV
,
err
os
.
Error
)
{
func
LookupSRV
(
service
,
proto
,
name
string
)
(
cname
string
,
addrs
[]
*
SRV
,
err
os
.
Error
)
{
var
r
*
syscall
.
DNSRecord
var
r
*
syscall
.
DNSRecord
e
:=
syscall
.
DnsQuery
(
name
,
syscall
.
DNS_TYPE_SRV
,
0
,
nil
,
&
r
,
nil
)
target
:=
"_"
+
service
+
"._"
+
proto
+
"."
+
name
e
:=
syscall
.
DnsQuery
(
target
,
syscall
.
DNS_TYPE_SRV
,
0
,
nil
,
&
r
,
nil
)
if
int
(
e
)
!=
0
{
if
int
(
e
)
!=
0
{
return
""
,
nil
,
os
.
NewSyscallError
(
"LookupSRV"
,
int
(
e
))
return
""
,
nil
,
os
.
NewSyscallError
(
"LookupSRV"
,
int
(
e
))
}
}
...
@@ -76,3 +77,7 @@ func LookupPort(network, service string) (port int, err os.Error) {
...
@@ -76,3 +77,7 @@ func LookupPort(network, service string) (port int, err os.Error) {
}
}
return
int
(
syscall
.
Ntohs
(
s
.
Port
)),
nil
return
int
(
syscall
.
Ntohs
(
s
.
Port
)),
nil
}
}
func
isDomainName
(
s
string
)
bool
{
panic
(
"unimplemented"
)
}
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