Do not send extraneous chained MMBs

This commit is contained in:
Sasha Koshka 2025-11-19 15:16:44 -05:00
parent 7d189df741
commit 3b5a498aa5

View File

@ -425,7 +425,9 @@ func (this *writerA) Write(data []byte) (n int, err error) {
}
func (this *writerA) Close() error {
if len(this.buffer) > 0 {
this.flush(0)
}
this.open = false
return nil
}
@ -453,7 +455,9 @@ func (this *writerA) writeOne(data []byte) (n int, err error) {
}
func (this *writerA) flush(ccb uint64) error {
return this.parent.parent.sendMessageSafe(this.parent.id, this.method, ccb, this.buffer)
err := this.parent.parent.sendMessageSafe(this.parent.id, this.method, ccb, this.buffer)
this.buffer = this.buffer[0:0]
return err
}
type incomingMessage struct {