Commit fded0ebe authored by David Vorick's avatar David Vorick

Merge branch '3401-http-stream-listed-in-renter-downloads-endpoint' into 'master'

Resolve "HTTP Stream listed in /renter/downloads endpoint"

Closes #3401

See merge request !3427
parents 23b877e8 f8f1841c
Pipeline #46966990 passed with stages
in 123 minutes and 31 seconds
......@@ -342,10 +342,12 @@ func (r *Renter) managedDownload(p modules.RenterDownloadParameters) (*download,
return nil, err
}
// Add the download object to the download queue.
r.downloadHistoryMu.Lock()
r.downloadHistory = append(r.downloadHistory, d)
r.downloadHistoryMu.Unlock()
// Add the download object to the download history if it's not a stream.
if destinationType != destinationTypeSeekStream {
r.downloadHistoryMu.Lock()
r.downloadHistory = append(r.downloadHistory, d)
r.downloadHistoryMu.Unlock()
}
// Return the download object
return d, nil
......
......@@ -736,6 +736,17 @@ func testStreamingCache(t *testing.T, tg *siatest.TestGroup) {
t.Fatal("download took longer than 30 seconds")
}
}
// Make sure that the stream downloads don't show up in the download
// history.
rgg, err := r.RenterDownloadsGet()
if err != nil {
t.Fatal(err)
}
for _, download := range rgg.Downloads {
if download.DestinationType == "httpseekstream" {
t.Fatal("Stream downloads shouldn't be added to the history")
}
}
}
// testUploadDownload is a subtest that uses an existing TestGroup to test if
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment