Update packages, fix testutil. Goddamit godep.

This commit is contained in:
Audrius Butkevicius 2015-11-23 21:29:23 +00:00
parent 77572d0aee
commit bc5b95be8a

View File

@ -53,7 +53,10 @@ func main() {
if join { if join {
log.Println("Creating client") log.Println("Creating client")
relay := client.NewProtocolClient(uri, []tls.Certificate{cert}, nil) relay, err := client.NewClient(uri, []tls.Certificate{cert}, nil, 10*time.Second)
if err != nil {
log.Fatal(err)
}
log.Println("Created client") log.Println("Created client")
go relay.Serve() go relay.Serve()
@ -62,7 +65,7 @@ func main() {
go func() { go func() {
log.Println("Starting invitation receiver") log.Println("Starting invitation receiver")
for invite := range relay.Invitations { for invite := range relay.Invitations() {
select { select {
case recv <- invite: case recv <- invite:
log.Println("Received invitation", invite) log.Println("Received invitation", invite)
@ -87,7 +90,7 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
invite, err := client.GetInvitationFromRelay(uri, id, []tls.Certificate{cert}) invite, err := client.GetInvitationFromRelay(uri, id, []tls.Certificate{cert}, 10*time.Second)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@ -101,7 +104,7 @@ func main() {
connectToStdio(stdin, conn) connectToStdio(stdin, conn)
log.Println("Finished", conn.RemoteAddr(), conn.LocalAddr()) log.Println("Finished", conn.RemoteAddr(), conn.LocalAddr())
} else if test { } else if test {
if client.TestRelay(uri, []tls.Certificate{cert}) { if client.TestRelay(uri, []tls.Certificate{cert}, time.Second, 2*time.Second, 4) {
log.Println("OK") log.Println("OK")
} else { } else {
log.Println("FAIL") log.Println("FAIL")