InputStream: CheapSeeking() returns false only for HTTP

Seeking on NFS or SMB is cheap.  Actually, only HTTP streams are
expensive to seek.  This enables a few features on NFS/SMB files, for
example Ogg tags.
This commit is contained in:
Max Kellermann 2014-08-19 21:39:12 +02:00
parent 87eb5cbced
commit d87cf5146e

View File

@ -20,7 +20,7 @@
#include "config.h"
#include "InputStream.hxx"
#include "thread/Cond.hxx"
#include "util/UriUtil.hxx"
#include "util/StringUtil.hxx"
#include <assert.h>
@ -76,7 +76,8 @@ gcc_pure
static bool
ExpensiveSeeking(const char *uri)
{
return uri_has_scheme(uri);
return StringStartsWith(uri, "http://") ||
StringStartsWith(uri, "https://");
}
bool