Skip to content

Commit

Permalink
istream/brotli: offload to worker thread
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jan 14, 2025
1 parent 7b67301 commit 47da976
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 286 deletions.
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cm4all-beng-proxy (19.1) unstable; urgency=low
* {http,nghttp2}/server: use optimized per-request memory allocator
* access_log: send multiple log datagrams with sendmmsg()
* translation/cache: reduce CPU and memory overhead
* brotli: offload to worker thread

--

Expand Down
5 changes: 4 additions & 1 deletion src/bp/Response.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "translation/Transformation.hxx"
#include "translation/Service.hxx"
#include "http/Address.hxx"
#include "thread/Pool.hxx"
#include "co/Task.hxx"
#include "uri/Relocate.hxx"
#include "uri/Verify.hxx"
Expand Down Expand Up @@ -205,7 +206,9 @@ Request::ApplyAutoCompress(HttpHeaders &response_headers,
resource_tag,
response_headers, response_body, "br",
[this, &response_headers](auto &&i){
return NewBrotliEncoderIstream(pool, std::move(i),
return NewBrotliEncoderIstream(pool,
thread_pool_get_queue(instance.event_loop),
std::move(i),
{.text_mode = IsTextMimeType(response_headers)});
}))
return;
Expand Down
Loading

0 comments on commit 47da976

Please sign in to comment.