vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood
2018-06-17 17:59:12 +01:00
parent 3f0789e2db
commit 08021c4636
2474 changed files with 435818 additions and 282709 deletions

View File

@ -13,6 +13,7 @@ import (
"net/http"
"net/textproto"
"strings"
"sync"
"google.golang.org/api/googleapi"
)
@ -105,12 +106,13 @@ type typeReader struct {
typ string
}
// multipartReader combines the contents of multiple readers to creat a multipart/related HTTP body.
// multipartReader combines the contents of multiple readers to create a multipart/related HTTP body.
// Close must be called if reads from the multipartReader are abandoned before reaching EOF.
type multipartReader struct {
pr *io.PipeReader
pipeOpen bool
ctype string
mu sync.Mutex
pipeOpen bool
}
func newMultipartReader(parts []typeReader) *multipartReader {
@ -146,10 +148,13 @@ func (mp *multipartReader) Read(data []byte) (n int, err error) {
}
func (mp *multipartReader) Close() error {
mp.mu.Lock()
if !mp.pipeOpen {
mp.mu.Unlock()
return nil
}
mp.pipeOpen = false
mp.mu.Unlock()
return mp.pr.Close()
}