Skip to content

Commit

Permalink
fix across platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
hggq committed Oct 6, 2023
1 parent 373c193 commit 3b656af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vendor/httpserver/src/https_brotli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace http
{
std::array<unsigned char, 2048> buffer;
auto instance = BrotliEncoderCreateInstance(nullptr, nullptr, nullptr);
unsigned long available_in = data.length(), available_out = buffer.size();
size_t available_in = data.length(), available_out = buffer.size();
const unsigned char *next_in = reinterpret_cast<const unsigned char *>(data.c_str());
unsigned char *next_out = buffer.data();

Expand All @@ -29,7 +29,7 @@ namespace http
{
auto instance = BrotliEncoderCreateInstance(nullptr, nullptr, nullptr);

unsigned long available_in = data.length(), available_out = buffer_size;
size_t available_in = data.length(), available_out = buffer_size;
const unsigned char *next_in = reinterpret_cast<const unsigned char *>(data.c_str());
unsigned char *next_out = buffer;

Expand All @@ -51,7 +51,7 @@ namespace http
std::array<unsigned char, 2048> buffer;
BrotliDecoderResult per_result;
auto instance = BrotliDecoderCreateInstance(nullptr, nullptr, nullptr);
unsigned long available_in = data.length(), available_out = buffer.size();
size_t available_in = data.length(), available_out = buffer.size();
const unsigned char *next_in = reinterpret_cast<const unsigned char *>(data.c_str());
unsigned char *next_out = buffer.data();

Expand All @@ -71,7 +71,7 @@ namespace http
{
BrotliDecoderResult per_result;
auto instance = BrotliDecoderCreateInstance(nullptr, nullptr, nullptr);
unsigned long available_in = data.length(), available_out = buffer_size;
size_t available_in = data.length(), available_out = buffer_size;
const unsigned char *next_in = reinterpret_cast<const unsigned char *>(data.c_str());
unsigned char *next_out = buffer;
do
Expand Down
3 changes: 3 additions & 0 deletions vendor/httpserver/src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2750,6 +2750,7 @@ void httpserver::httpwatch()
clientrunpool.printthreads(false);
#endif

#if (defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__)) && !defined(__CYGWIN__)
// save access.log
if (!access_loglist.empty())
{
Expand Down Expand Up @@ -2825,6 +2826,8 @@ void httpserver::httpwatch()
}
close(fd);
}
#endif

if (n_write > 0)
{
n_write = 0;
Expand Down

0 comments on commit 3b656af

Please sign in to comment.