Merge branch 'develop' of github.com:gogits/gogs into develop

This commit is contained in:
Unknwon 2015-03-25 17:50:26 -04:00
commit f2b851388b

View file

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"io" "io"
"reflect" "reflect"
"errors"
) )
type Packet struct { type Packet struct {
@ -177,6 +178,10 @@ func readBytes(reader io.Reader, buf []byte) error {
idx := 0 idx := 0
buflen := len(buf) buflen := len(buf)
if reader == nil {
return errors.New("reader was nil, aborting")
}
for idx < buflen { for idx < buflen {
n, err := reader.Read(buf[idx:]) n, err := reader.Read(buf[idx:])
if err != nil { if err != nil {