Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion engine/extensions/remote-engine/remote_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ size_t StreamWriteCallback(char* ptr, size_t size, size_t nmemb,
CTL_DBG(chunk);
Json::Value check_error;
Json::Reader reader;
if (reader.parse(chunk, check_error)) {
context->chunks += chunk;
if (reader.parse(context->chunks, check_error) ||
(reader.parse(chunk, check_error) &&
chunk.find("error") != std::string::npos)) {
CTL_WRN(context->chunks);
CTL_WRN(chunk);
CTL_INF("Request: " << context->last_request);
Json::Value status;
Expand Down
1 change: 1 addition & 0 deletions engine/extensions/remote-engine/remote_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct StreamContext {
std::string stream_template;
bool need_stop = true;
std::string last_request;
std::string chunks;
};
struct CurlResponse {
std::string body;
Expand Down
Loading