#93 增加GZIP解压缩失败后Passthrough整个连接的功能

This commit is contained in:
Lu Qiuwen
2018-11-25 15:23:44 +08:00
committed by 陆秋文
parent 4255024798
commit 691e1b83a1

View File

@@ -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;
}
}