diff --git a/tutorial/tutorial-05-http_proxy.cc b/tutorial/tutorial-05-http_proxy.cc index 769a72c5..6dcae329 100644 --- a/tutorial/tutorial-05-http_proxy.cc +++ b/tutorial/tutorial-05-http_proxy.cc @@ -59,10 +59,6 @@ void http_callback(WFHttpTask *task) (tutorial_series_context *)series->get_context(); auto *proxy_resp = context->proxy_task->get_resp(); - /* Some servers may close the socket as the end of http response. */ - if (state == WFT_STATE_SYS_ERROR && error == ECONNRESET) - state = WFT_STATE_SUCCESS; - if (state == WFT_STATE_SUCCESS) { const void *body; @@ -81,7 +77,6 @@ void http_callback(WFHttpTask *task) else { const char *err_string; - int error = task->get_error(); if (state == WFT_STATE_SYS_ERROR) err_string = strerror(error); @@ -93,8 +88,7 @@ void http_callback(WFHttpTask *task) err_string = "URL error (Cannot be a HTTPS proxy)"; fprintf(stderr, "%s: Fetch failed. state = %d, error = %d: %s\n", - context->url.c_str(), state, task->get_error(), - err_string); + context->url.c_str(), state, error, err_string); /* As a tutorial, make it simple. And ignore reply status. */ proxy_resp->set_status_code("404");