Do not send extraneous chained MMBs
This commit is contained in:
parent
7d189df741
commit
3b5a498aa5
@ -425,7 +425,9 @@ func (this *writerA) Write(data []byte) (n int, err error) {
|
||||
}
|
||||
|
||||
func (this *writerA) Close() error {
|
||||
this.flush(0)
|
||||
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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user