clean up
This commit is contained in:
@@ -158,8 +158,6 @@ func doUpload(uploadUrl string, filename string, cipher bool, reader io.Reader,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
println("data size", clearDataLen)
|
|
||||||
|
|
||||||
if cipher {
|
if cipher {
|
||||||
// encrypt(gzip(data))
|
// encrypt(gzip(data))
|
||||||
|
|
||||||
@@ -170,12 +168,10 @@ func doUpload(uploadUrl string, filename string, cipher bool, reader io.Reader,
|
|||||||
err = fmt.Errorf("encrypt input: %v", encryptionErr)
|
err = fmt.Errorf("encrypt input: %v", encryptionErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
println("encrypted data size", len(encryptedData))
|
|
||||||
|
|
||||||
// upload data
|
// upload data
|
||||||
uploadResult, err = upload_content(uploadUrl, func(w io.Writer) (err error) {
|
uploadResult, err = upload_content(uploadUrl, func(w io.Writer) (err error) {
|
||||||
n, err := w.Write(encryptedData)
|
_, err = w.Write(encryptedData)
|
||||||
println("writtern data size", n)
|
|
||||||
return
|
return
|
||||||
}, "", false, "", nil, jwt)
|
}, "", false, "", nil, jwt)
|
||||||
if uploadResult != nil {
|
if uploadResult != nil {
|
||||||
@@ -187,8 +183,7 @@ func doUpload(uploadUrl string, filename string, cipher bool, reader io.Reader,
|
|||||||
} else {
|
} else {
|
||||||
// upload data
|
// upload data
|
||||||
uploadResult, err = upload_content(uploadUrl, func(w io.Writer) (err error) {
|
uploadResult, err = upload_content(uploadUrl, func(w io.Writer) (err error) {
|
||||||
n, err := w.Write(data)
|
_, err = w.Write(data)
|
||||||
println("written data size", n)
|
|
||||||
return
|
return
|
||||||
}, filename, contentIsGzipped, mtype, pairMap, jwt)
|
}, filename, contentIsGzipped, mtype, pairMap, jwt)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user