release buffer

This commit is contained in:
Darien Raymond 2017-04-15 22:29:38 +02:00
parent abe790181e
commit 02ce3ffded
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 4 additions and 0 deletions

View File

@ -245,6 +245,8 @@ func (w *AuthenticationWriter) Write(b []byte) (int, error) {
}
func (w *AuthenticationWriter) WriteMultiBuffer(mb buf.MultiBuffer) (int, error) {
defer mb.Release()
const StartIndex = 17 * 1024
var totalBytes int
for {

View File

@ -385,6 +385,8 @@ type UDPWriter struct {
}
func (w *UDPWriter) Write(mb buf.MultiBuffer) error {
defer mb.Release()
for _, b := range mb {
if err := w.writeInternal(b); err != nil {
return err