Skip to content

Commit

Permalink
update to libhttpserver v0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
mirostauder committed Oct 17, 2023
1 parent 6bf96ea commit ca4ed99
Show file tree
Hide file tree
Showing 18 changed files with 226 additions and 386 deletions.
13 changes: 0 additions & 13 deletions deps/libhttpserver/basic_auth_fail_response.hpp.patch

This file was deleted.

13 changes: 0 additions & 13 deletions deps/libhttpserver/create_webserver.hpp.patch

This file was deleted.

13 changes: 0 additions & 13 deletions deps/libhttpserver/deferred_response.hpp.patch

This file was deleted.

13 changes: 0 additions & 13 deletions deps/libhttpserver/digest_auth_fail_response.hpp.patch

This file was deleted.

29 changes: 11 additions & 18 deletions deps/libhttpserver/empty_uri_log_crash.patch
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
commit 2678fcf0bc7a645a4043f5c194dfc75da35ab072
Author: Miro Stauder <[email protected]>
Date: Tue Jan 24 15:05:11 2023 +0000

webserver.patch

diff --git a/src/webserver.cpp b/src/webserver.cpp
index 38542f2..0ae69dc 100644
--- a/src/webserver.cpp
+++ b/src/webserver.cpp
@@ -441,7 +441,7 @@ MHD_Result policy_callback (void *cls, const struct sockaddr* addr, socklen_t ad
void* uri_log(void* cls, const char* uri)
{
struct details::modded_request* mr = new details::modded_request();
- mr->complete_uri = new string(uri);
+ mr->complete_uri = new string(uri == NULL ? "" : uri);
mr->second = false;
return ((void*)mr);
diff -upr libhttpserver.clean/src/webserver.cpp libhttpserver/src/webserver.cpp
--- libhttpserver.clean/src/webserver.cpp 2023-06-16 03:49:56.000000000 +0000
+++ libhttpserver/src/webserver.cpp 2023-10-17 10:11:18.350231611 +0000
@@ -420,7 +420,7 @@ void* uri_log(void* cls, const char* uri
std::ignore = con;

auto mr = std::make_unique<details::modded_request>();
- mr->complete_uri = std::make_unique<string>(uri);
+ mr->complete_uri = std::make_unique<string>(uri == NULL ? "" : uri);
return reinterpret_cast<void*>(mr.release());
}

13 changes: 0 additions & 13 deletions deps/libhttpserver/file_response.hpp.patch

This file was deleted.

27 changes: 10 additions & 17 deletions deps/libhttpserver/final_val_post_process.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
commit 3dab3a696e61c341029ad459608f2626e6e5547f
Author: Miro Stauder <[email protected]>
Date: Mon Jan 9 12:06:29 2023 +0000

final_val_post_process.patch

diff --git a/src/webserver.cpp b/src/webserver.cpp
index 38542f2..e6ef554 100644
--- a/src/webserver.cpp
+++ b/src/webserver.cpp
@@ -674,6 +674,14 @@ MHD_Result webserver::finalize_answer(
{
if(hrm->is_allowed(method))
{
diff -upr libhttpserver.clean/src/webserver.cpp libhttpserver/src/webserver.cpp
--- libhttpserver.clean/src/webserver.cpp 2023-06-16 03:49:56.000000000 +0000
+++ libhttpserver/src/webserver.cpp 2023-10-17 10:03:00.696612945 +0000
@@ -676,6 +676,14 @@ MHD_Result webserver::finalize_answer(MH
if (found) {
try {
if (hrm->is_allowed(method)) {
+ // NOTE: Here 'MHD_destroy_post_processor' is required for performing a final 'post_process'
+ // of the 'URL Encode'. This ensures ensures the processing of final key without value left
+ // at the end of the buffer. See function internal doc at 'postprocessor.c'.
Expand All @@ -20,6 +13,6 @@ index 38542f2..e6ef554 100644
+ mr->pp = NULL;
+ }
+
mr->dhrs = ((hrm)->*(mr->callback))(*mr->dhr); //copy in memory (move in case)
if (mr->dhrs->get_response_code() == -1)
{
mr->dhrs = ((hrm)->*(mr->callback))(*mr->dhr); // copy in memory (move in case)
if (mr->dhrs.get() == nullptr || mr->dhrs->get_response_code() == -1) {
mr->dhrs = internal_error_page(mr);
13 changes: 0 additions & 13 deletions deps/libhttpserver/http_request.hpp.patch

This file was deleted.

13 changes: 0 additions & 13 deletions deps/libhttpserver/http_resource.hpp.patch

This file was deleted.

17 changes: 0 additions & 17 deletions deps/libhttpserver/http_response.hpp.patch

This file was deleted.

2 changes: 1 addition & 1 deletion deps/libhttpserver/libhttpserver
Binary file removed deps/libhttpserver/libhttpserver-0.18.2.tar.gz
Binary file not shown.
Binary file added deps/libhttpserver/libhttpserver-0.19.0.tar.gz
Binary file not shown.
Loading

0 comments on commit ca4ed99

Please sign in to comment.