Fix misprint.

GitOrigin-RevId: cec8d77edaf44c5527af694300118ad28748f5f4
This commit is contained in:
levlam 2020-07-23 02:12:00 +03:00
parent db628a8c9e
commit 813e2b2961
2 changed files with 7 additions and 6 deletions

View File

@ -111,7 +111,7 @@ Result<size_t> HttpReader::read_next(HttpQuery *query) {
gzip_flow_ = GzipByteFlow(Gzip::Mode::Decode);
GzipByteFlow::Options options;
options.write_watermark.low = 0;
options.write_watermark.hight = max_post_size_ + 10;
options.write_watermark.high = max_post_size_ + 10;
gzip_flow_.set_options(options);
//gzip_flow_.set_max_output_size(MAX_CONTENT_SIZE);
*source >> gzip_flow_;
@ -177,7 +177,7 @@ Result<size_t> HttpReader::read_next(HttpQuery *query) {
state_ = State::ReadContentToFile;
GzipByteFlow::Options options;
options.write_watermark.low = 4 << 20;
options.write_watermark.hight = 8 << 20;
options.write_watermark.high = 8 << 20;
gzip_flow_.set_options(options);
continue;
}

View File

@ -9,6 +9,7 @@
#include "td/utils/buffer.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
#include <limits>
namespace td {
@ -66,19 +67,19 @@ class ByteFlowBaseCommon : public ByteFlowInterface {
if (read_size < min(need_size_, options_.read_watermark.low)) {
can_read = false;
}
if (read_size >= max(need_size_, options_.read_watermark.hight)) {
if (read_size >= max(need_size_, options_.read_watermark.high)) {
can_read = true;
}
} else {
//Alway can read when input is closed
// always can read when input is closed
can_read = true;
}
// update can_write
{
auto write_size = get_write_size();
if (write_size > options_.write_watermark.hight) {
if (write_size > options_.write_watermark.high) {
can_write = false;
}
if (write_size <= options_.write_watermark.low) {
@ -114,7 +115,7 @@ class ByteFlowBaseCommon : public ByteFlowInterface {
struct Watermark {
size_t low{std::numeric_limits<size_t>::max()};
size_t hight{0};
size_t high{0};
};
struct Options {
Watermark write_watermark;