| 2131 | } |
| 2132 | |
| 2133 | CtPtr ProtocolV2::handle_server_ident(ceph::bufferlist &payload) |
| 2134 | { |
| 2135 | ldout(cct, 20) << __func__ |
| 2136 | << " payload.length()=" << payload.length() << dendl; |
| 2137 | |
| 2138 | if (state != SESSION_CONNECTING) { |
| 2139 | lderr(cct) << __func__ << " not in session connect state!" << dendl; |
| 2140 | return _fault(); |
| 2141 | } |
| 2142 | |
| 2143 | auto server_ident = ServerIdentFrame::Decode(payload); |
| 2144 | ldout(cct, 5) << __func__ << " received server identification:" |
| 2145 | << " addrs=" << server_ident.addrs() |
| 2146 | << " gid=" << server_ident.gid() |
| 2147 | << " global_seq=" << server_ident.global_seq() |
| 2148 | << " features_supported=" << std::hex |
| 2149 | << server_ident.supported_features() |
| 2150 | << " features_required=" << server_ident.required_features() |
| 2151 | << " flags=" << server_ident.flags() |
| 2152 | << " cookie=" << server_ident.cookie() << std::dec << dendl; |
| 2153 | |
| 2154 | // is this who we intended to talk to? |
| 2155 | // be a bit forgiving here, since we may be connecting based on addresses parsed out |
| 2156 | // of mon_host or something. |
| 2157 | if (!server_ident.addrs().contains(connection->target_addr)) { |
| 2158 | ldout(cct,1) << __func__ << " peer identifies as " << server_ident.addrs() |
| 2159 | << ", does not include " << connection->target_addr << dendl; |
| 2160 | return _fault(); |
| 2161 | } |
| 2162 | |
| 2163 | server_cookie = server_ident.cookie(); |
| 2164 | |
| 2165 | connection->set_peer_addrs(server_ident.addrs()); |
| 2166 | peer_name = entity_name_t(connection->get_peer_type(), server_ident.gid()); |
| 2167 | connection->set_features(server_ident.supported_features() & |
| 2168 | connection->policy.features_supported); |
| 2169 | peer_global_seq = server_ident.global_seq(); |
| 2170 | |
| 2171 | connection->policy.lossy = server_ident.flags() & CEPH_MSG_CONNECT_LOSSY; |
| 2172 | |
| 2173 | backoff = utime_t(); |
| 2174 | ldout(cct, 10) << __func__ << " connect success " << connect_seq |
| 2175 | << ", lossy = " << connection->policy.lossy << ", features " |
| 2176 | << connection->get_features() << dendl; |
| 2177 | |
| 2178 | if (connection->delay_state) { |
| 2179 | ceph_assert(connection->delay_state->ready()); |
| 2180 | } |
| 2181 | |
| 2182 | connection->dispatch_queue->queue_connect(connection); |
| 2183 | messenger->ms_deliver_handle_fast_connect(connection); |
| 2184 | |
| 2185 | return ready(); |
| 2186 | } |
| 2187 | |
| 2188 | CtPtr ProtocolV2::send_compression_request() { |
| 2189 | state = COMPRESSION_CONNECTING; |
nothing calls this directly
no test coverage detected