Fix OpenStream dropping connection errors

This commit is contained in:
Shtorm
2026-08-09 15:03:14 +03:00
parent cb664d1a4b
commit 21a23d7488

View File

@@ -116,7 +116,8 @@ func (c *DefaultDialerClient) OpenStream(ctx context.Context, url string, sessio
FillStreamRequest(req, sessionId, "", c.options) FillStreamRequest(req, sessionId, "", c.options)
wrc = &WaitReadCloser{Wait: make(chan struct{}), Cancel: cancel} wrc = &WaitReadCloser{Wait: make(chan struct{}), Cancel: cancel}
go func() { go func() {
resp, err := c.client.Do(req) var resp *http.Response
resp, err = c.client.Do(req)
if err != nil { if err != nil {
if !uploadOnly && !errors.Is(err, context.Canceled) { // stream-down is enough if !uploadOnly && !errors.Is(err, context.Canceled) { // stream-down is enough
c.Close() c.Close()