Skip to content

Commit

Permalink
- fix tls conn buffer state
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Jun 9, 2021
1 parent fe13dfe commit df6e3c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion std/crypto/tls/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -963,14 +963,15 @@ func (c *Conn) write(data []byte) (int, error) {
}

func (c *Conn) flush() (int, error) {
c.buffering = false

if len(c.sendBuf) == 0 {
return 0, nil
}

n, err := c.conn.Write(c.sendBuf)
c.bytesSent += int64(n)
c.sendBuf = nil
c.buffering = false
return n, err
}

Expand Down

0 comments on commit df6e3c6

Please sign in to comment.