فهرست منبع

common : avoid logging partial messages (which can contain broken UTF-8 sequences) (#14937)

* bug-fix: don't attempt to log partial parsed messages to avoid crash due to unfinished UTF-8 sequences
kallewoof 5 ماه پیش
والد
کامیت
1a67fcc306
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      common/chat.cpp

+ 3 - 1
common/chat.cpp

@@ -1944,6 +1944,8 @@ common_chat_msg common_chat_parse(const std::string & input, bool is_partial, co
         }
     }
     auto msg = builder.result();
-    LOG_DBG("Parsed message: %s\n", common_chat_msgs_to_json_oaicompat<json>({msg}).at(0).dump().c_str());
+    if (!is_partial) {
+        LOG_DBG("Parsed message: %s\n", common_chat_msgs_to_json_oaicompat<json>({msg}).at(0).dump().c_str());
+    }
     return msg;
 }