Commit 87eb5cbc authored by Max Kellermann's avatar Max Kellermann

InputStream: move code to ExpensiveSeeking()

parent 181edf4b
...@@ -67,10 +67,22 @@ InputStream::LockWaitReady() ...@@ -67,10 +67,22 @@ InputStream::LockWaitReady()
WaitReady(); WaitReady();
} }
/**
* Is seeking on resources behind this URI "expensive"? For example,
* seeking in a HTTP file requires opening a new connection with a new
* HTTP request.
*/
gcc_pure
static bool
ExpensiveSeeking(const char *uri)
{
return uri_has_scheme(uri);
}
bool bool
InputStream::CheapSeeking() const InputStream::CheapSeeking() const
{ {
return IsSeekable() && !uri_has_scheme(uri.c_str()); return IsSeekable() && !ExpensiveSeeking(uri.c_str());
} }
bool bool
......
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