* @brief Forwards every chunk into the SSE reader. */
| 208 | * @brief Forwards every chunk into the SSE reader. |
| 209 | */ |
| 210 | void AI::GeminiReply::onReplyReadyRead() |
| 211 | { |
| 212 | if (!m_reply || m_finished) |
| 213 | return; |
| 214 | |
| 215 | const auto status = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); |
| 216 | if (status >= 400) |
| 217 | return; |
| 218 | |
| 219 | m_sse->feed(m_reply->readAll()); |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * @brief Handles end-of-stream: drain remaining buffer and finalize. |