fixes here and there
This commit is contained in:
@@ -46,20 +46,20 @@ func HandleHeadRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torren
|
||||
|
||||
torrent, _ := t.TorrentMap.Get(accessKey)
|
||||
if torrent == nil {
|
||||
log.Errorf("Cannot find torrent %s in the directory %s", accessKey, baseDirectory)
|
||||
log.Warnf("Cannot find torrent %s in the directory %s", accessKey, baseDirectory)
|
||||
http.Error(w, "File not found", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
file, _ := torrent.SelectedFiles.Get(filename)
|
||||
if file == nil {
|
||||
log.Errorf("Cannot find file from path %s", requestPath)
|
||||
log.Warnf("Cannot find file from path %s", requestPath)
|
||||
http.Error(w, "Cannot find file", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
if file.Link == "" {
|
||||
// This is a dead file, serve an alternate file
|
||||
log.Errorf("File %s is no longer available", filename)
|
||||
log.Warnf("File %s is no longer available", filename)
|
||||
http.Error(w, "Cannot find file", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user