| 140 | } |
| 141 | |
| 142 | void GetMysqlBufDebugString(const char * buf, int len, std::string & debug_str) { |
| 143 | debug_str = ""; |
| 144 | for (int i = 0; i < len; ++i) { |
| 145 | char debug_buf[16] = { 0 }; |
| 146 | snprintf(debug_buf, sizeof(debug_buf), "(%u,0x%X)", (unsigned int) ((unsigned char) buf[i]), buf[i]); |
| 147 | debug_str = debug_str + " " + string(debug_buf); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | int SockAddrToIPPort(struct sockaddr * addr, std::string & ip, int & port) { |
| 152 | if (addr->sa_family == AF_INET) { |