From 691e1b83a1b28575166910697c1acef602f6797d Mon Sep 17 00:00:00 2001 From: Lu Qiuwen Date: Sun, 25 Nov 2018 15:23:44 +0800 Subject: [PATCH] =?UTF-8?q?#93=20=E5=A2=9E=E5=8A=A0GZIP=E8=A7=A3=E5=8E=8B?= =?UTF-8?q?=E7=BC=A9=E5=A4=B1=E8=B4=A5=E5=90=8EPassthrough=E6=95=B4?= =?UTF-8?q?=E4=B8=AA=E8=BF=9E=E6=8E=A5=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/protocol/http/src/http_half.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugin/protocol/http/src/http_half.cpp b/plugin/protocol/http/src/http_half.cpp index 34f4bda..9ede1b2 100644 --- a/plugin/protocol/http/src/http_half.cpp +++ b/plugin/protocol/http/src/http_half.cpp @@ -422,10 +422,17 @@ static int __parser_callback_on_body(struct http_parser * parser, const char * a length, hf_private->event_cb_user); } - if (ret < 0) + if (unlikely(ret < 0)) { - //TODO: what to do if writter raise an error. - assert(0); + static const char * __str_error_uncompress = "Failed at uncompress HTTP body"; + static const char * __str_error_event = "Failed at calling user's callback for HTTP body"; + + const char * __what = hf_private->cv_uncompress_object != NULL ? __str_error_uncompress : __str_error_event; + const char * __str_stream = hf_private->session->hc_private->stream->str_stream_info; + const char * __str_url = hf_private->session->hs_public.req->req_spec.url; + + TFE_LOG_ERROR(g_http_plugin->access_logger, "%s %s %s, ret = %d. ", __str_stream, __str_url, __what, ret); + hf_private->is_passthrough = true; return -1; } }