Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/httpserver/basic_auth_fail_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class basic_auth_fail_response : public string_response
{
}

basic_auth_fail_response(basic_auth_fail_response&& other) noexcept:
string_response(std::move(other)),
realm(std::move(other.realm))
{
}

basic_auth_fail_response& operator=(const basic_auth_fail_response& b)
{
if (this == &b) return *this;
Expand All @@ -66,6 +72,16 @@ class basic_auth_fail_response : public string_response
return *this;
}

basic_auth_fail_response& operator=(basic_auth_fail_response&& b)
{
if (this == &b) return *this;

(string_response&) (*this) = std::move(b);
this->realm = std::move(b.realm);

return *this;
}

~basic_auth_fail_response()
{
}
Expand Down
172 changes: 172 additions & 0 deletions src/httpserver/create_webserver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,178 @@ class create_webserver
{
}

create_webserver(const create_webserver& b):
_port(b._port),
_start_method(b._start_method),
_max_threads(b._max_threads),
_max_connections(b._max_connections),
_memory_limit(b._memory_limit),
_content_size_limit(b._content_size_limit),
_connection_timeout(b._connection_timeout),
_per_IP_connection_limit(b._per_IP_connection_limit),
_log_access(b._log_access),
_log_error(b._log_error),
_validator(b._validator),
_unescaper(b._unescaper),
_bind_address(b._bind_address),
_bind_socket(b._bind_socket),
_max_thread_stack_size(b._max_thread_stack_size),
_use_ssl(b._use_ssl),
_use_ipv6(b._use_ipv6),
_debug(b._debug),
_pedantic(b._pedantic),
_https_mem_key(b._https_mem_key),
_https_mem_cert(b._https_mem_cert),
_https_mem_trust(b._https_mem_trust),
_https_priorities(b._https_priorities),
_cred_type(b._cred_type),
_digest_auth_random(b._digest_auth_random),
_nonce_nc_size(b._nonce_nc_size),
_default_policy(b._default_policy),
_basic_auth_enabled(b._basic_auth_enabled),
_digest_auth_enabled(b._digest_auth_enabled),
_regex_checking(b._regex_checking),
_ban_system_enabled(b._ban_system_enabled),
_post_process_enabled(b._post_process_enabled),
_deferred_enabled(b._deferred_enabled),
_single_resource(b._single_resource),
_not_found_resource(b._not_found_resource),
_method_not_allowed_resource(b._method_not_allowed_resource),
_internal_error_resource(b._internal_error_resource)
{
}

create_webserver(create_webserver&& b):
_port(b._port),
_start_method(b._start_method),
_max_threads(b._max_threads),
_max_connections(b._max_connections),
_memory_limit(b._memory_limit),
_content_size_limit(b._content_size_limit),
_connection_timeout(b._connection_timeout),
_per_IP_connection_limit(b._per_IP_connection_limit),
_log_access(std::move(b._log_access)),
_log_error(std::move(b._log_error)),
_validator(std::move(b._validator)),
_unescaper(std::move(b._unescaper)),
_bind_address(std::move(b._bind_address)),
_bind_socket(b._bind_socket),
_max_thread_stack_size(b._max_thread_stack_size),
_use_ssl(b._use_ssl),
_use_ipv6(b._use_ipv6),
_debug(b._debug),
_pedantic(b._pedantic),
_https_mem_key(std::move(b._https_mem_key)),
_https_mem_cert(std::move(b._https_mem_cert)),
_https_mem_trust(std::move(b._https_mem_trust)),
_https_priorities(std::move(b._https_priorities)),
_cred_type(b._cred_type),
_digest_auth_random(std::move(b._digest_auth_random)),
_nonce_nc_size(b._nonce_nc_size),
_default_policy(b._default_policy),
_basic_auth_enabled(b._basic_auth_enabled),
_digest_auth_enabled(b._digest_auth_enabled),
_regex_checking(b._regex_checking),
_ban_system_enabled(b._ban_system_enabled),
_post_process_enabled(b._post_process_enabled),
_deferred_enabled(b._deferred_enabled),
_single_resource(b._single_resource),
_not_found_resource(std::move(b._not_found_resource)),
_method_not_allowed_resource(std::move(b._method_not_allowed_resource)),
_internal_error_resource(std::move(b._internal_error_resource))
{
}

create_webserver& operator=(const create_webserver& b)
{
if (this == &b) return *this;

this->_port = b._port;
this->_start_method = b._start_method;
this->_max_threads = b._max_threads;
this->_max_connections = b._max_connections;
this->_memory_limit = b._memory_limit;
this->_content_size_limit = b._content_size_limit;
this->_connection_timeout = b._connection_timeout;
this->_per_IP_connection_limit = b._per_IP_connection_limit;
this->_log_access = b._log_access;
this->_log_error = b._log_error;
this->_validator = b._validator;
this->_unescaper = b._unescaper;
this->_bind_address = b._bind_address;
this->_bind_socket = b._bind_socket;
this->_max_thread_stack_size = b._max_thread_stack_size;
this->_use_ssl = b._use_ssl;
this->_use_ipv6 = b._use_ipv6;
this->_debug = b._debug;
this->_pedantic = b._pedantic;
this->_https_mem_key = b._https_mem_key;
this->_https_mem_cert = b._https_mem_cert;
this->_https_mem_trust = b._https_mem_trust;
this->_https_priorities = b._https_priorities;
this->_cred_type = b._cred_type;
this->_digest_auth_random = b._digest_auth_random;
this->_nonce_nc_size = b._nonce_nc_size;
this->_default_policy = b._default_policy;
this->_basic_auth_enabled = b._basic_auth_enabled;
this->_digest_auth_enabled = b._digest_auth_enabled;
this->_regex_checking = b._regex_checking;
this->_ban_system_enabled = b._ban_system_enabled;
this->_post_process_enabled = b._post_process_enabled;
this->_deferred_enabled = b._deferred_enabled;
this->_single_resource = b._single_resource;
this->_not_found_resource = b._not_found_resource;
this->_method_not_allowed_resource = b._method_not_allowed_resource;
this->_internal_error_resource = b._internal_error_resource;

return *this;
}

create_webserver& operator=(create_webserver&& b)
{
if (this == &b) return *this;

this->_port = b._port;
this->_start_method = b._start_method;
this->_max_threads = b._max_threads;
this->_max_connections = b._max_connections;
this->_memory_limit = b._memory_limit;
this->_content_size_limit = b._content_size_limit;
this->_connection_timeout = b._connection_timeout;
this->_per_IP_connection_limit = b._per_IP_connection_limit;
this->_log_access = std::move(b._log_access);
this->_log_error = std::move(b._log_error);
this->_validator = std::move(b._validator);
this->_unescaper = std::move(b._unescaper);
this->_bind_address = std::move(b._bind_address);
this->_bind_socket = b._bind_socket;
this->_max_thread_stack_size = b._max_thread_stack_size;
this->_use_ssl = b._use_ssl;
this->_use_ipv6 = b._use_ipv6;
this->_debug = b._debug;
this->_pedantic = b._pedantic;
this->_https_mem_key = std::move(b._https_mem_key);
this->_https_mem_cert = std::move(b._https_mem_cert);
this->_https_mem_trust = std::move(b._https_mem_trust);
this->_https_priorities = std::move(b._https_priorities);
this->_cred_type = b._cred_type;
this->_digest_auth_random = std::move(b._digest_auth_random);
this->_nonce_nc_size = b._nonce_nc_size;
this->_default_policy = b._default_policy;
this->_basic_auth_enabled = b._basic_auth_enabled;
this->_digest_auth_enabled = b._digest_auth_enabled;
this->_regex_checking = b._regex_checking;
this->_ban_system_enabled = b._ban_system_enabled;
this->_post_process_enabled = b._post_process_enabled;
this->_deferred_enabled = b._deferred_enabled;
this->_single_resource = b._single_resource;
this->_not_found_resource = std::move(b._not_found_resource);
this->_method_not_allowed_resource = std::move(b._method_not_allowed_resource);
this->_internal_error_resource = std::move(b._internal_error_resource);

return *this;
}

explicit create_webserver(uint16_t port):
_port(port),
_start_method(http::http_utils::INTERNAL_SELECT),
Expand Down
19 changes: 19 additions & 0 deletions src/httpserver/deferred_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,31 @@ class deferred_response : public string_response
{
}

deferred_response(deferred_response&& other) noexcept:
string_response(std::move(other)),
cycle_callback(std::move(other.cycle_callback)),
completed(other.completed)
{
}

deferred_response& operator=(const deferred_response& b)
{
if (this == &b) return *this;

(string_response&) (*this) = b;
this->cycle_callback = b.cycle_callback;
this->completed = b.completed;

return *this;
}

deferred_response& operator=(deferred_response&& b)
{
if (this == &b) return *this;

(string_response&) (*this) = std::move(b);
this->cycle_callback = std::move(b.cycle_callback);
this->completed = b.completed;

return *this;
}
Expand Down
49 changes: 49 additions & 0 deletions src/httpserver/details/modded_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,55 @@ struct modded_request
second(false)
{
}

modded_request(const modded_request& b):
pp(b.pp),
complete_uri(b.complete_uri),
standardized_url(b.standardized_url),
ws(b.ws),
dhr(b.dhr),
second(b.second)
{
}

modded_request(modded_request&& b):
pp(std::move(b.pp)),
complete_uri(std::move(b.complete_uri)),
standardized_url(std::move(b.standardized_url)),
ws(std::move(b.ws)),
dhr(std::move(b.dhr)),
second(b.second)
{
}

modded_request& operator=(const modded_request& b)
{
if (this == &b) return *this;

this->pp = b.pp;
this->complete_uri = b.complete_uri;
this->standardized_url = b.standardized_url;
this->ws = b.ws;
this->dhr = b.dhr;
this->second = b.second;

return *this;
}

modded_request& operator=(modded_request&& b)
{
if (this == &b) return *this;

this->pp = std::move(b.pp);
this->complete_uri = std::move(b.complete_uri);
this->standardized_url = std::move(b.standardized_url);
this->ws = std::move(b.ws);
this->dhr = std::move(b.dhr);
this->second = b.second;

return *this;
}

~modded_request()
{
if (NULL != pp)
Expand Down
20 changes: 20 additions & 0 deletions src/httpserver/digest_auth_fail_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ class digest_auth_fail_response : public string_response
{
}

digest_auth_fail_response(digest_auth_fail_response&& other) noexcept:
string_response(std::move(other)),
realm(std::move(other.realm)),
opaque(std::move(other.opaque)),
reload_nonce(other.reload_nonce)
{
}

digest_auth_fail_response& operator=(const digest_auth_fail_response& b)
{
if (this == &b) return *this;
Expand All @@ -76,6 +84,18 @@ class digest_auth_fail_response : public string_response
return *this;
}

digest_auth_fail_response& operator=(digest_auth_fail_response&& b)
{
if (this == &b) return *this;

(string_response&) (*this) = std::move(b);
this->realm = std::move(b.realm);
this->opaque = std::move(b.opaque);
this->reload_nonce = b.reload_nonce;

return *this;
}

~digest_auth_fail_response()
{
}
Expand Down
16 changes: 16 additions & 0 deletions src/httpserver/file_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class file_response : public http_response
{
}

file_response(file_response&& other) noexcept:
http_response(std::move(other)),
filename(std::move(other.filename))
{
}

file_response& operator=(const file_response& b)
{
if (this == &b) return *this;
Expand All @@ -65,6 +71,16 @@ class file_response : public http_response
return *this;
}

file_response& operator=(file_response&& b)
{
if (this == &b) return *this;

(http_response&) (*this) = std::move(b);
this->filename = std::move(b.filename);

return *this;
}

~file_response()
{
}
Expand Down
Loading