diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-03-17 17:02:36 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-03-17 17:04:06 +0900 |
| commit | 420c721c7da46ab1c633b019441b7b623215fd12 (patch) | |
| tree | 8443996fcee8a5df3427708ecdd353fba54f941b /internal/pipewire | |
| parent | bac583f89edd1360150143ff51f7264c01aa69ec (diff) | |
all: raise timeout defaults
This avoids timing out on systems running very slowly.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire')
| -rw-r--r-- | internal/pipewire/core.go | 2 | ||||
| -rw-r--r-- | internal/pipewire/pipewire.go | 8 | ||||
| -rw-r--r-- | internal/pipewire/pipewire_test.go | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/internal/pipewire/core.go b/internal/pipewire/core.go index 2161acf7..026f75bb 100644 --- a/internal/pipewire/core.go +++ b/internal/pipewire/core.go @@ -514,7 +514,7 @@ var ErrNotDone = errors.New("did not receive a Core::Done event targeting previo const ( // syncTimeout is the maximum duration [Core.Sync] is allowed to take before // receiving [CoreDone] or failing. - syncTimeout = 10 * time.Second + syncTimeout = RoundtripTimeout + 15*time.Second ) // Sync queues a [CoreSync] message for the PipeWire server and initiates a Roundtrip. diff --git a/internal/pipewire/pipewire.go b/internal/pipewire/pipewire.go index bd1d4e8e..0538863a 100644 --- a/internal/pipewire/pipewire.go +++ b/internal/pipewire/pipewire.go @@ -701,14 +701,14 @@ func (ctx *Context) Roundtrip() (err error) { } const ( - // roundtripTimeout is the maximum duration socket operations during + // RoundtripTimeout is the maximum duration socket operations during // Context.roundtrip is allowed to block for. - roundtripTimeout = 5 * time.Second + RoundtripTimeout = 30 * time.Second ) // roundtrip implements the Roundtrip method without checking proxyErrors. func (ctx *Context) roundtrip() (err error) { - ctx.conn.MightBlock(roundtripTimeout) + ctx.conn.MightBlock(RoundtripTimeout) if err = ctx.sendmsg(ctx.buf, ctx.pendingFiles...); err != nil { return } @@ -742,7 +742,7 @@ func (ctx *Context) roundtrip() (err error) { }() var remaining []byte - ctx.conn.MightBlock(roundtripTimeout) + ctx.conn.MightBlock(RoundtripTimeout) for { remaining, err = ctx.consume(remaining) if err == nil { diff --git a/internal/pipewire/pipewire_test.go b/internal/pipewire/pipewire_test.go index 0187391c..1671601c 100644 --- a/internal/pipewire/pipewire_test.go +++ b/internal/pipewire/pipewire_test.go @@ -717,7 +717,7 @@ type stubUnixConn struct { } func (conn *stubUnixConn) MightBlock(timeout time.Duration) { - if timeout != 5*time.Second { + if timeout != pipewire.RoundtripTimeout { panic("unexpected timeout " + timeout.String()) } if conn.current == 0 || |
