MCPcopy Create free account
hub / github.com/Tencent/phxsql / GetDBNameFromReqBuf

Method GetDBNameFromReqBuf

phxsqlproxy/io_channel.cpp:262–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262void IOChannel::GetDBNameFromReqBuf(const char * buf, int buf_size) {
263 if (buf_size > 5) {
264 char cmd = buf[4];
265 if (cmd == COM_INIT_DB) {
266 int buf_len = 0;
267 memcpy(&buf_len, buf, 3);
268 db_name_ = std::string(buf + 5, buf_len - 1);
269 LOG_DEBUG("bufsize %d buflen %d ret [%s]", buf_size, buf_len, db_name_.c_str());
270 }
271 }
272}
273
274void IOChannel::ByteFromConnectDestSvr(uint32_t byte_size) {
275 if (byte_size != 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected