Fixed: 修复storage_report_my_server_id中长度变量引用错误的问题

在storage_report_my_server_id方法中,设置pkg_len值时,将常量引用从IP_ADDRESS_SIZE修改为正确的FDFS_STORAGE_ID_MAX_SIZE常量。
pull/667/head
sunqiangwei1988 2023-10-03 13:25:58 +08:00
parent 7c58b147ca
commit 5060231f33
1 changed files with 1 additions and 1 deletions

View File

@ -709,7 +709,7 @@ static int storage_report_my_server_id(ConnectionInfo *pStorageServer)
pHeader = (TrackerHeader *)out_buff; pHeader = (TrackerHeader *)out_buff;
memset(out_buff, 0, sizeof(out_buff)); memset(out_buff, 0, sizeof(out_buff));
long2buff(IP_ADDRESS_SIZE, pHeader->pkg_len); long2buff(FDFS_STORAGE_ID_MAX_SIZE, pHeader->pkg_len);
pHeader->cmd = STORAGE_PROTO_CMD_REPORT_SERVER_ID; pHeader->cmd = STORAGE_PROTO_CMD_REPORT_SERVER_ID;
strcpy(out_buff + sizeof(TrackerHeader), g_my_server_id_str); strcpy(out_buff + sizeof(TrackerHeader), g_my_server_id_str);
if ((result=tcpsenddata_nb(pStorageServer->sock, out_buff, \ if ((result=tcpsenddata_nb(pStorageServer->sock, out_buff, \