| 195 | } |
| 196 | |
| 197 | void onClientMessage(const TcpConnectionPtr& conn, Buffer* buf, Timestamp) |
| 198 | { |
| 199 | size_t len = buf->readableBytes(); |
| 200 | transferred_.addAndGet(len); |
| 201 | receivedMessages_.incrementAndGet(); |
| 202 | if (!conn->getContext().empty()) |
| 203 | { |
| 204 | int id = boost::any_cast<int>(conn->getContext()); |
| 205 | sendBackendBuffer(id, buf); |
| 206 | // assert(buf->readableBytes() == 0); |
| 207 | } |
| 208 | else |
| 209 | { |
| 210 | buf->retrieveAll(); |
| 211 | // FIXME: error handling |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | void onBackendConnection(const TcpConnectionPtr& conn) |
| 216 | { |
nothing calls this directly
no test coverage detected