MXS-1220: Temporarily remove PATCH method

The PATCH method isn't supported in older versions of microhttpd. As this
functionality wasn't used, it can be removed until it is needed. The PUT
method already allows updates by defining complete resources so PATCH is
only an improvement, not a requirement.
This commit is contained in:
Markus Mäkelä 2017-04-24 19:05:05 +03:00
parent e62be5034a
commit b736776c8f
2 changed files with 2 additions and 11 deletions

View File

@ -57,7 +57,7 @@ static inline size_t request_data_length(MHD_Connection *connection)
static bool modifies_data(MHD_Connection *connection, string method)
{
return (method == MHD_HTTP_METHOD_POST || method == MHD_HTTP_METHOD_PUT ||
method == MHD_HTTP_METHOD_PATCH || method == MHD_HTTP_METHOD_DELETE) &&
method == MHD_HTTP_METHOD_DELETE) &&
request_data_length(connection);
}
@ -182,7 +182,7 @@ int handle_client(void *cls,
bool mxs_admin_init()
{
http_daemon = MHD_start_daemon(MHD_USE_EPOLL_INTERNALLY | MHD_USE_DUAL_STACK,
http_daemon = MHD_start_daemon(MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY | MHD_USE_DUAL_STACK,
config_get_global_options()->admin_port,
NULL, NULL,
handle_client, NULL,

View File

@ -406,10 +406,6 @@ public:
{
l.push_back(MHD_HTTP_METHOD_DELETE);
}
if (find_resource(m_patch, request) != m_patch.end())
{
l.push_back(MHD_HTTP_METHOD_PATCH);
}
stringstream rval;
@ -441,10 +437,6 @@ public:
{
return process_request_type(m_post, request);
}
else if (request.get_verb() == MHD_HTTP_METHOD_PATCH)
{
return process_request_type(m_patch, request);
}
else if (request.get_verb() == MHD_HTTP_METHOD_DELETE)
{
return process_request_type(m_delete, request);
@ -477,7 +469,6 @@ private:
ResourceList m_put; /**< PUT request handlers */
ResourceList m_post; /**< POST request handlers */
ResourceList m_delete; /**< DELETE request handlers */
ResourceList m_patch; /**< PATCH request handlers */
};
static RootResource resources; /**< Core resource set */