MXS-1220: Take the resource handler into use

The resource handler system is now usable but it doesn't perform anything
useful. Although, this will allows it to be tested for correctness.

Minor fixes to HttpResponse output and renaming of functions.
This commit is contained in:
Markus Mäkelä
2017-04-17 10:36:33 +03:00
committed by Markus Mäkelä
parent 8b1c0cd1a1
commit 900bf2db5a
6 changed files with 46 additions and 38 deletions

View File

@ -18,6 +18,7 @@
#include <map>
#include <string>
#include <tr1/memory>
#include <cstdint>
#include <maxscale/jansson.hh>
#include <maxscale/utils.hh>
@ -132,24 +133,37 @@ public:
}
/**
* @brief Get request resource
* @brief Get complete request URI
*
* @return The request resource
* @return The complete request URI
*/
const string& get_resource() const
const string& get_uri() const
{
return m_resource;
}
/**
* @brief Get request resource parts
* @brief Get URI part
*
* @return The request resource split into parts
* @param idx Zero indexed part number in URI
*
* @return The request URI part or empty string if no part was found
*/
const deque<string>& get_resource_parts() const
const string uri_part(uint32_t idx) const
{
return m_resource_parts;
return m_resource_parts.size() > idx ? m_resource_parts[idx] : "";
}
/**
* @brief Return how many parts are in the URI
*
* @return Number of URI parts
*/
size_t uri_part_count() const
{
return m_resource_parts.size();
}
private:
HttpRequest();
HttpRequest(const HttpRequest&);