read body of HTTP POST request to prevent 'connection reset by peer' error on client side

This commit is contained in:
Yakov Olkhovskiy 2024-01-07 14:40:12 +00:00
parent 9ca4be5d91
commit feab812712

View File

@ -464,6 +464,9 @@ void CatBoostLibraryBridgeRequestHandler::handleRequest(HTTPServerRequest & requ
{ {
if (method == "catboost_list") if (method == "catboost_list")
{ {
auto & read_buf = request.getStream();
params.read(read_buf);
ExternalModelInfos model_infos = CatBoostLibraryHandlerFactory::instance().getModelInfos(); ExternalModelInfos model_infos = CatBoostLibraryHandlerFactory::instance().getModelInfos();
writeIntBinary(static_cast<UInt64>(model_infos.size()), out); writeIntBinary(static_cast<UInt64>(model_infos.size()), out);
@ -501,6 +504,9 @@ void CatBoostLibraryBridgeRequestHandler::handleRequest(HTTPServerRequest & requ
} }
else if (method == "catboost_removeAllModels") else if (method == "catboost_removeAllModels")
{ {
auto & read_buf = request.getStream();
params.read(read_buf);
CatBoostLibraryHandlerFactory::instance().removeAllModels(); CatBoostLibraryHandlerFactory::instance().removeAllModels();
String res = "1"; String res = "1";