mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +00:00
Update packages, fix testutil. Goddamit godep.
This commit is contained in:
parent
77572d0aee
commit
bc5b95be8a
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user