Loading src/http/HttpProxyServer.cpp +11 −7 Changes for src/http/HttpProxyServer.cpp: 11 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -589,18 +589,22 @@ void HttpProxyController::RequestEvent(libhttppp::HttpRequest &curreq, const int : method == "PUT" ? PUTREQUEST : PATCHREQUEST); std::vector<char> requestBody(curreq.RecvData.begin(), curreq.RecvData.end()); body = (method == "POST") ? client.Post(outreq, requestBody) : (method == "PUT") ? client.Put(outreq, requestBody) : client.Patch(outreq, requestBody); // libhttppp defaults maxTries to 0, meaning unlimited retries on transport // errors. A down backend can therefore hold this dispatch worker forever. // One attempt also avoids replaying a write after the backend may have acted // on it but closed before sending its response. body = (method == "POST") ? client.Post(outreq, requestBody, /*maxTries=*/1) : (method == "PUT") ? client.Put(outreq, requestBody, /*maxTries=*/1) : client.Patch(outreq, requestBody, /*maxTries=*/1); } else if (method == "DELETE") { outreq.setRequestType(DELETEREQUEST); body = client.Delete(outreq); body = client.Delete(outreq, /*maxTries=*/1); } else if (method == "OPTIONS") { outreq.setRequestType(OPTIONSREQUEST); body = client.Options(outreq); body = client.Options(outreq, /*maxTries=*/1); } else if (method == "HEAD") { outreq.setRequestType(HEADREQUEST); body = client.Head(outreq); body = client.Head(outreq, /*maxTries=*/1); } else { outreq.setRequestType(GETREQUEST); Loading Loading @@ -762,7 +766,7 @@ void HttpProxyController::RequestEvent(libhttppp::HttpRequest &curreq, const int return; } body = client.Get(outreq); body = client.Get(outreq, /*maxTries=*/1); } libhttppp::HttpResponse curres; Loading Loading
src/http/HttpProxyServer.cpp +11 −7 Changes for src/http/HttpProxyServer.cpp: 11 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -589,18 +589,22 @@ void HttpProxyController::RequestEvent(libhttppp::HttpRequest &curreq, const int : method == "PUT" ? PUTREQUEST : PATCHREQUEST); std::vector<char> requestBody(curreq.RecvData.begin(), curreq.RecvData.end()); body = (method == "POST") ? client.Post(outreq, requestBody) : (method == "PUT") ? client.Put(outreq, requestBody) : client.Patch(outreq, requestBody); // libhttppp defaults maxTries to 0, meaning unlimited retries on transport // errors. A down backend can therefore hold this dispatch worker forever. // One attempt also avoids replaying a write after the backend may have acted // on it but closed before sending its response. body = (method == "POST") ? client.Post(outreq, requestBody, /*maxTries=*/1) : (method == "PUT") ? client.Put(outreq, requestBody, /*maxTries=*/1) : client.Patch(outreq, requestBody, /*maxTries=*/1); } else if (method == "DELETE") { outreq.setRequestType(DELETEREQUEST); body = client.Delete(outreq); body = client.Delete(outreq, /*maxTries=*/1); } else if (method == "OPTIONS") { outreq.setRequestType(OPTIONSREQUEST); body = client.Options(outreq); body = client.Options(outreq, /*maxTries=*/1); } else if (method == "HEAD") { outreq.setRequestType(HEADREQUEST); body = client.Head(outreq); body = client.Head(outreq, /*maxTries=*/1); } else { outreq.setRequestType(GETREQUEST); Loading Loading @@ -762,7 +766,7 @@ void HttpProxyController::RequestEvent(libhttppp::HttpRequest &curreq, const int return; } body = client.Get(outreq); body = client.Get(outreq, /*maxTries=*/1); } libhttppp::HttpResponse curres; Loading