internal/pipewire: reorder context struct
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m25s
Test / Hakurei (push) Successful in 3m25s
Test / Hpkg (push) Successful in 4m15s
Test / Sandbox (race detector) (push) Successful in 4m28s
Test / Hakurei (race detector) (push) Successful in 3m12s
Test / Flake checks (push) Successful in 1m39s
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m25s
Test / Hakurei (push) Successful in 3m25s
Test / Hpkg (push) Successful in 4m15s
Test / Sandbox (race detector) (push) Successful in 4m28s
Test / Hakurei (race detector) (push) Successful in 3m12s
Test / Flake checks (push) Successful in 1m39s
This change reorders and groups struct elements. This improves readability since this struct holds a lot of state loosely related to each other. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -52,8 +52,11 @@ type Context struct {
|
|||||||
buf []byte
|
buf []byte
|
||||||
// Current [Header.Sequence] value, incremented every write.
|
// Current [Header.Sequence] value, incremented every write.
|
||||||
sequence Int
|
sequence Int
|
||||||
// Current server-side [Header.Sequence] value, incremented on every event processed.
|
// Pending file descriptors to be sent with the next message.
|
||||||
remoteSequence Int
|
pendingFiles []int
|
||||||
|
// File count already kept track of in [Header].
|
||||||
|
headerFiles int
|
||||||
|
|
||||||
// Proxy id associations.
|
// Proxy id associations.
|
||||||
proxy map[Int]eventProxy
|
proxy map[Int]eventProxy
|
||||||
// Newly allocated proxies pending acknowledgement from the server.
|
// Newly allocated proxies pending acknowledgement from the server.
|
||||||
@@ -62,12 +65,14 @@ type Context struct {
|
|||||||
nextId Int
|
nextId Int
|
||||||
// Proxies targeted by the [CoreDestroy] event pending until next [CoreSync].
|
// Proxies targeted by the [CoreDestroy] event pending until next [CoreSync].
|
||||||
pendingDestruction map[Int]struct{}
|
pendingDestruction map[Int]struct{}
|
||||||
// Server side registry generation number.
|
|
||||||
generation Long
|
// Proxy for built-in core events.
|
||||||
// Pending file descriptors to be sent with the next message.
|
core Core
|
||||||
pendingFiles []int
|
// Proxy for built-in client events.
|
||||||
// File count already kept track of in [Header].
|
client Client
|
||||||
headerFiles int
|
|
||||||
|
// Current server-side [Header.Sequence] value, incremented on every event processed.
|
||||||
|
remoteSequence 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.
|
||||||
//
|
//
|
||||||
@@ -83,13 +88,11 @@ type Context struct {
|
|||||||
// Pending footer value deferred to the next round trip,
|
// Pending footer value deferred to the next round trip,
|
||||||
// sent if pendingFooter is nil. This is for emulating upstream behaviour
|
// sent if pendingFooter is nil. This is for emulating upstream behaviour
|
||||||
deferredPendingFooter KnownSize
|
deferredPendingFooter KnownSize
|
||||||
|
// Server side registry generation number.
|
||||||
|
generation Long
|
||||||
// Deferred operations ran after a [Core.Sync] completes or Close is called. Errors
|
// Deferred operations ran after a [Core.Sync] completes or Close is called. Errors
|
||||||
//are reported as part of [ProxyConsumeError] and is not considered fatal unless panicked.
|
//are reported as part of [ProxyConsumeError] and is not considered fatal unless panicked.
|
||||||
syncComplete []func() error
|
syncComplete []func() error
|
||||||
// Proxy for built-in core events.
|
|
||||||
core Core
|
|
||||||
// Proxy for built-in client events.
|
|
||||||
client Client
|
|
||||||
|
|
||||||
// Passed to [Conn.Recvmsg]. Not copied if sufficient for all received messages.
|
// Passed to [Conn.Recvmsg]. Not copied if sufficient for all received messages.
|
||||||
iovecBuf [1 << 15]byte
|
iovecBuf [1 << 15]byte
|
||||||
|
|||||||
Reference in New Issue
Block a user