ping should not expect a message if it's not sent
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m41s

This commit is contained in:
matst80
2024-11-10 11:48:40 +01:00
parent 321b96b47e
commit a52d3b52e7

View File

@@ -383,10 +383,13 @@ func (p *SyncedPool) OwnerChanged(id CartId, host string) error {
func DoPing(host *RemoteHost) error { func DoPing(host *RemoteHost) error {
log.Printf("Pinging remote %s\n", host.Host) log.Printf("Pinging remote %s\n", host.Host)
SendPacket(host, Ping, func(w io.Writer) error { err := SendPacket(host, Ping, func(w io.Writer) error {
return nil return nil
}) })
_, err := host.Expect(Pong, time.Second) if err != nil {
return err
}
_, err = host.Expect(Pong, time.Second)
if err != nil { if err != nil {
return err return err