Backport transport fixes and update 2.6.3 packages
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -156,10 +156,6 @@ func (c *slowOpenConn) WriterReplaceable() bool {
|
||||
return c.conn.Load() != nil
|
||||
}
|
||||
|
||||
func (c *slowOpenConn) LazyHeadroom() bool {
|
||||
return c.conn.Load() == nil
|
||||
}
|
||||
|
||||
func (c *slowOpenConn) NeedHandshake() bool {
|
||||
return c.conn.Load() == nil
|
||||
}
|
||||
|
||||
@@ -111,23 +111,13 @@ type observableLogger struct {
|
||||
|
||||
func (l *observableLogger) Log(ctx context.Context, level Level, args []any) {
|
||||
level = OverrideLevelFromContext(level, ctx)
|
||||
if level > l.level && l.platformWriter == nil {
|
||||
if level > l.level && l.platformWriter == nil && !l.needObservable {
|
||||
return
|
||||
}
|
||||
nowTime := time.Now()
|
||||
if level <= l.level {
|
||||
if l.needObservable {
|
||||
message, messageSimple := l.formatter.FormatWithSimple(ctx, level, l.tag, F.ToString(args...), nowTime)
|
||||
if level == LevelPanic {
|
||||
panic(message)
|
||||
}
|
||||
l.writer.Write([]byte(message))
|
||||
if level == LevelFatal {
|
||||
os.Exit(1)
|
||||
}
|
||||
l.subscriber.Emit(Entry{level, messageSimple})
|
||||
} else {
|
||||
message := l.formatter.Format(ctx, level, l.tag, F.ToString(args...), nowTime)
|
||||
if l.needObservable {
|
||||
message, messageSimple := l.formatter.FormatWithSimple(ctx, level, l.tag, F.ToString(args...), nowTime)
|
||||
if level <= l.level {
|
||||
if level == LevelPanic {
|
||||
panic(message)
|
||||
}
|
||||
@@ -136,6 +126,16 @@ func (l *observableLogger) Log(ctx context.Context, level Level, args []any) {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
l.subscriber.Emit(Entry{level, messageSimple})
|
||||
} else if level <= l.level {
|
||||
message := l.formatter.Format(ctx, level, l.tag, F.ToString(args...), nowTime)
|
||||
if level == LevelPanic {
|
||||
panic(message)
|
||||
}
|
||||
l.writer.Write([]byte(message))
|
||||
if level == LevelFatal {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
if l.platformWriter != nil {
|
||||
l.platformWriter.WriteMessage(level, l.platformFormatter.Format(ctx, level, l.tag, F.ToString(args...), nowTime))
|
||||
|
||||
@@ -109,7 +109,8 @@ func (c *DefaultDialerClient) OpenStream(ctx context.Context, url string, sessio
|
||||
FillStreamRequest(req, sessionId, "", c.options)
|
||||
wrc = &WaitReadCloser{Wait: make(chan struct{}), Cancel: cancel}
|
||||
go func() {
|
||||
resp, err := c.client.Do(req)
|
||||
var resp *http.Response
|
||||
resp, err = c.client.Do(req)
|
||||
if err != nil {
|
||||
if !uploadOnly && !errors.Is(err, context.Canceled) { // stream-down is enough
|
||||
c.Close()
|
||||
|
||||
Reference in New Issue
Block a user