Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
900c1fbf
Commit
900c1fbf
authored
Dec 24, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/id: when dup id, wait on it.
parent
ef0c25f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
net/id.go
net/id.go
+3
-2
No files found.
net/id.go
View file @
900c1fbf
...
...
@@ -38,10 +38,11 @@ func NewIDService(n Network) *IDService {
func
(
ids
*
IDService
)
IdentifyConn
(
c
Conn
)
{
ids
.
currmu
.
Lock
()
if
_
,
found
:=
ids
.
currid
[
c
];
found
{
if
wait
,
found
:=
ids
.
currid
[
c
];
found
{
ids
.
currmu
.
Unlock
()
log
.
Debugf
(
"IdentifyConn called twice on: %s"
,
c
)
return
// already identifying it.
<-
wait
// already identifying it. wait for it.
return
}
ids
.
currid
[
c
]
=
make
(
chan
struct
{})
ids
.
currmu
.
Unlock
()
...
...
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