Permalink
Browse files

Merge pull request #84 from jaredwilkening/master

fixed bug in checksums
  • Loading branch information...
2 parents e20191c + 15db1c0 commit 23ba00dc3f5ee02c16ea1fc63a8b3ed813c6219b @jaredwilkening jaredwilkening committed Jul 11, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 shock-server/request/request.go
@@ -130,12 +130,12 @@ func ParseMultipartForm(r *http.Request) (params map[string]string, files node.F
*/
files[part.FormName()] = node.FormFile{Name: part.FileName(), Path: tmpPath, Checksum: make(map[string]string)}
if tmpFile, err := os.Create(tmpPath); err == nil {
- buffer := make([]byte, 32*1024)
md5c := make(chan checkSumCom)
sha1c := make(chan checkSumCom)
writeChecksum(md5.New, md5c)
writeChecksum(sha1.New, sha1c)
for {
+ buffer := make([]byte, 32*1024)
n, err := part.Read(buffer)
if n == 0 || err != nil {
md5c <- checkSumCom{n: 0}

0 comments on commit 23ba00d

Please sign in to comment.