Skip to content

Commit

Permalink
another arbiter refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Apr 12, 2017
1 parent c703812 commit 4f6babc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions vendor/arbiter/arbiter.cpp
Expand Up @@ -1250,7 +1250,7 @@ std::unique_ptr<std::size_t> Http::tryGetSize(std::string path) const
std::unique_ptr<std::size_t> size;

auto http(m_pool.acquire());
Response res(http.head(path));
Response res(http.head(typedPath(path)));

if (res.ok() && res.headers().count("Content-Length"))
{
Expand Down Expand Up @@ -1322,7 +1322,7 @@ bool Http::get(
bool good(false);

auto http(m_pool.acquire());
Response res(http.get(path, headers, query));
Response res(http.get(typedPath(path), headers, query));

if (res.ok())
{
Expand All @@ -1341,7 +1341,7 @@ void Http::put(
{
auto http(m_pool.acquire());

if (!http.put(path, data, headers, query).ok())
if (!http.put(typedPath(path), data, headers, query).ok())
{
throw ArbiterError("Couldn't HTTP PUT to " + path);
}
Expand Down
7 changes: 6 additions & 1 deletion vendor/arbiter/arbiter.hpp
@@ -1,7 +1,7 @@
/// Arbiter amalgamated header (https://github.com/connormanning/arbiter).
/// It is intended to be used with #include "arbiter.hpp"

// Git SHA: 1e9cadf66ddc1bc5ea7d4e044136f6072b8b305a
// Git SHA: 311b81e3dcb5e8c55b2148f7eba46a12cff66914

// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: LICENSE
Expand Down Expand Up @@ -994,6 +994,11 @@ class Http : public Driver
return get(path, data, http::Headers(), http::Query());
}

std::string typedPath(const std::string& p) const
{
return type() + "://" + p;
}

http::Pool& m_pool;
};

Expand Down

0 comments on commit 4f6babc

Please sign in to comment.