mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 23:13:11 -06:00
mediaapi/writers/download: Remove done TODOs
This commit is contained in:
parent
5d67787c46
commit
8f68f61117
|
|
@ -268,7 +268,6 @@ func Download(w http.ResponseWriter, req *http.Request, origin types.ServerName,
|
|||
// write to client request's response body
|
||||
bytesTemp, respErr := w.Write(buffer[:bytesRead])
|
||||
if bytesTemp != bytesRead || (respErr != nil && respErr != io.EOF) {
|
||||
// TODO: BORKEN
|
||||
logger.Errorf("bytesTemp %v != bytesRead %v : %v", bytesTemp, bytesRead, respErr)
|
||||
fetchError = errResponse
|
||||
break
|
||||
|
|
@ -277,13 +276,11 @@ func Download(w http.ResponseWriter, req *http.Request, origin types.ServerName,
|
|||
if fetchError == nil || (fetchError != errFileIsTooLarge && fetchError != errWrite) {
|
||||
// if larger than cfg.MaxFileSize then stop writing to disk and discard cached file
|
||||
if bytesWritten+int64(len(buffer)) > int64(cfg.MaxFileSize) {
|
||||
// TODO: WAAAAHNING and clean up temp files
|
||||
fetchError = errFileIsTooLarge
|
||||
} else {
|
||||
// write to disk
|
||||
bytesTemp, writeErr := writer.Write(buffer)
|
||||
if writeErr != nil && writeErr != io.EOF {
|
||||
// TODO: WAAAAHNING and clean up temp files
|
||||
fetchError = errWrite
|
||||
} else {
|
||||
bytesWritten += int64(bytesTemp)
|
||||
|
|
|
|||
Loading…
Reference in a new issue