Skip to content
Closed
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
11 changes: 6 additions & 5 deletions proxy/http/HttpTunnel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,8 @@ HttpTunnel::producer_run(HttpTunnelProducer *p)

// (note that since we are not dechunking POST, this is the chunked size if chunked)
if (p->buffer_start->read_avail() > HttpConfig::m_master.post_copy_size) {
Warning("http_redirect, [HttpTunnel::producer_handler] post exceeds buffer limit, buffer_avail=%" PRId64 " limit=%" PRId64 "",
p->buffer_start->read_avail(), HttpConfig::m_master.post_copy_size);
Debug("http_redirect", "[HttpTunnel::producer_handler] post exceeds buffer limit, buffer_avail=%" PRId64 " limit=%" PRId64 "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this happened, the post request will fail. Are we sure this is something we can ignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zizhong Is the post failing completely or will it just fail to do a follow redirect?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In common cases, it fails only for the redirect. When post buffer(PR#2335) enabled, it will fail for the original too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not good for the common case, with buffering enabled. What change made it fail when post buffer is enabled? I don't believe this is how it worked before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is #2335, which utilizes the same buffer logic.

p->buffer_start->read_avail(), HttpConfig::m_master.post_copy_size);
sm->disable_redirect();
if (p->vc_type == HT_BUFFER_READ) {
producer_handler(VC_EVENT_ERROR, p);
Expand Down Expand Up @@ -1169,9 +1169,10 @@ HttpTunnel::producer_handler(int event, HttpTunnelProducer *p)
Debug("http_redirect", "[HttpTunnel::producer_handler] [%s %s]", p->name, HttpDebugNames::get_event_name(event));

if ((sm->postbuf_buffer_avail() + sm->postbuf_reader_avail()) > HttpConfig::m_master.post_copy_size) {
Warning("http_redirect, [HttpTunnel::producer_handler] post exceeds buffer limit, buffer_avail=%" PRId64
" reader_avail=%" PRId64 " limit=%" PRId64 "",
sm->postbuf_buffer_avail(), sm->postbuf_reader_avail(), HttpConfig::m_master.post_copy_size);
Debug("http_redirect",
"[HttpTunnel::producer_handler] post exceeds buffer limit, buffer_avail=%" PRId64 " reader_avail=%" PRId64
" limit=%" PRId64 "",
sm->postbuf_buffer_avail(), sm->postbuf_reader_avail(), HttpConfig::m_master.post_copy_size);
sm->disable_redirect();
if (p->vc_type == HT_BUFFER_READ) {
event = VC_EVENT_ERROR;
Expand Down