| 218 | } |
| 219 | |
| 220 | void ServerConnection::connection_ostream::flush_proxy() |
| 221 | { |
| 222 | if (owner->in_error) |
| 223 | { |
| 224 | buffer.clear(); |
| 225 | return; |
| 226 | } |
| 227 | |
| 228 | if (buffer.empty()) |
| 229 | return; |
| 230 | |
| 231 | CoreTextNotification msg; |
| 232 | |
| 233 | for (auto it = buffer.begin(); it != buffer.end(); ++it) |
| 234 | { |
| 235 | auto frag = msg.add_fragments(); |
| 236 | frag->set_text(it->second); |
| 237 | if (it->first >= 0) |
| 238 | frag->set_color(CoreTextFragment::Color(it->first)); |
| 239 | } |
| 240 | |
| 241 | buffer.clear(); |
| 242 | |
| 243 | if (!sendRemoteMessage(owner->socket, RPC_REPLY_TEXT, &msg, false)) |
| 244 | { |
| 245 | owner->in_error = true; |
| 246 | Core::printerr("Error writing text into client socket.\n"); |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | void ServerConnection::Accepted(CActiveSocket* socket) |
| 251 | { |