internal/pipewire: reset per-roundtrip state once per call
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m38s
Test / Sandbox (race detector) (push) Successful in 4m40s
Test / Hakurei (push) Successful in 5m1s
Test / Hpkg (push) Successful in 4m58s
Test / Hakurei (race detector) (push) Successful in 6m22s
Test / Flake checks (push) Successful in 1m21s
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m38s
Test / Sandbox (race detector) (push) Successful in 4m40s
Test / Hakurei (push) Successful in 5m1s
Test / Hpkg (push) Successful in 4m58s
Test / Hakurei (race detector) (push) Successful in 6m22s
Test / Flake checks (push) Successful in 1m21s
This was left in consume when relocating per-roundtrip code out of the per-receive consume method. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
130add21e5
commit
cf0e7d8c27
@ -63,7 +63,7 @@ type Context struct {
|
|||||||
generation Long
|
generation Long
|
||||||
// Pending file descriptors to be sent with the next message.
|
// Pending file descriptors to be sent with the next message.
|
||||||
pendingFiles []int
|
pendingFiles []int
|
||||||
// File count kept track of in [Header].
|
// File count already kept track of in [Header].
|
||||||
headerFiles int
|
headerFiles int
|
||||||
// Files from the server. This is discarded on every Roundtrip so eventProxy
|
// Files from the server. This is discarded on every Roundtrip so eventProxy
|
||||||
// implementations must make sure to close them to avoid leaking fds.
|
// implementations must make sure to close them to avoid leaking fds.
|
||||||
@ -585,6 +585,9 @@ func (ctx *Context) roundtrip() (err error) {
|
|||||||
if err = ctx.sendmsg(ctx.buf, ctx.pendingFiles...); err != nil {
|
if err = ctx.sendmsg(ctx.buf, ctx.pendingFiles...); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ctx.buf = ctx.buf[:0]
|
||||||
|
ctx.pendingFiles = ctx.pendingFiles[:0]
|
||||||
|
ctx.headerFiles = 0
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
var danglingFiles DanglingFilesError
|
var danglingFiles DanglingFilesError
|
||||||
@ -661,10 +664,6 @@ func (ctx *Context) consume(receiveRemaining []byte) (remaining []byte, err erro
|
|||||||
return
|
return
|
||||||
}()
|
}()
|
||||||
|
|
||||||
ctx.buf = ctx.buf[:0]
|
|
||||||
ctx.pendingFiles = ctx.pendingFiles[:0]
|
|
||||||
ctx.headerFiles = 0
|
|
||||||
|
|
||||||
if remaining, err = ctx.recvmsg(receiveRemaining); err != nil {
|
if remaining, err = ctx.recvmsg(receiveRemaining); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user