Skip to content

Commit

Permalink
Race condition found?
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Bortzmeyer committed Feb 15, 2010
1 parent 3988d1a commit 33ab45c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@ func udpListener(address *net.UDPAddr, comm chan bool) {
fmt.Printf("Cannot listen: %s\n", error)
os.Exit(1)
}
// TODO: should probably be moved INSIDE the loop. NewBuffer does not copy! (kmk)
message := make([]byte, 1024) // TODO: loop for reading, we may have more bytes...
for { // ever...
for { // ever... ??? (not convincing: kmk)
n, remaddr, error := listener.ReadFrom(message)
if error != nil {
fmt.Printf("Cannot read UDP from %s: %s\n", remaddr.String(), error)
Expand Down

0 comments on commit 33ab45c

Please sign in to comment.