| 159 | }; |
| 160 | |
| 161 | static Session* GetOrCreateSession(brpc::RedisConnContext* ctx) { |
| 162 | if (ctx == NULL) { |
| 163 | return NULL; |
| 164 | } |
| 165 | Session* s = static_cast<Session*>(ctx->get_session()); |
| 166 | if (s == NULL) { |
| 167 | s = new Session; |
| 168 | ctx->reset_session(s); |
| 169 | } |
| 170 | return s; |
| 171 | } |
| 172 | |
| 173 | static bool ParseEndpoint(const std::string& endpoint, std::string* host, int* port) { |
| 174 | size_t pos = endpoint.rfind(':'); |
no test coverage detected