]> Cypherpunks repositories - gostls13.git/commit
net/textproto: properly write terminating sequence if DotWriter is closed with no...
authorDaniel Cormier <danielc@knowbe4.com>
Fri, 10 Nov 2017 16:50:13 +0000 (11:50 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2019 20:27:10 +0000 (20:27 +0000)
commit93af67783796a48b3f59bd969dc0c528c37571ec
treea89f24088212ec6667ac2c52c64c348843b1331a
parent4d23cbc67100c1ce50b7d4fcc67e50091f92eb5b
net/textproto: properly write terminating sequence if DotWriter is closed with no writes

Fixed textproto.Writer.DotWriter() to properly write \r\n.\r\n to the buffer
when Close() is called without any bytes written. This properly writes the
terminating sequence outlined in RFC 5321 section 4.1.1.4 and RFC 3977
section 3.1.1, even when no other bytes are written.

Change-Id: I262fd2963ee76fff7ffae8e3cb0e86255694b361
Reviewed-on: https://go-review.googlesource.com/c/go/+/77350
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/textproto/writer.go
src/net/textproto/writer_test.go