forked from rosa/hakurei
cmd/mbf: close on abort completion
This enables synchronisation on the client side via epoll. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -194,11 +194,11 @@ func serve(
|
||||
}
|
||||
|
||||
case specialAbort:
|
||||
log.Println("aborting all pending cures")
|
||||
cm.c.Abort()
|
||||
if _err := conn.Close(); _err != nil {
|
||||
log.Println(_err)
|
||||
}
|
||||
log.Println("aborting all pending cures")
|
||||
cm.c.Abort()
|
||||
}
|
||||
|
||||
return
|
||||
@@ -339,5 +339,10 @@ func abortRemote(
|
||||
defer close(done)
|
||||
|
||||
err = writeSpecialHeader(conn, specialAbort)
|
||||
if err == nil {
|
||||
if _, err = conn.Read(make([]byte, 1)); err == io.EOF {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
return errors.Join(err, conn.Close())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user