diff --git a/main.cpp b/main.cpp index a48b333..1cc959f 100644 --- a/main.cpp +++ b/main.cpp @@ -442,9 +442,9 @@ int client_event_loop() mylog(log_warn,"huge packet,data len=%d (>%d).strongly suggested to set a smaller mtu at upper level,to get rid of this warn\n ",data_len,mtu_warn); } - if(cook_rm_crc32(data,data_len)!=0) + if(de_cook(data,data_len)!=0) { - mylog(log_debug,"cook_rm_crc32 check error"); + mylog(log_debug,"de_cook error"); continue; } @@ -602,9 +602,9 @@ int server_event_loop() } - if(cook_rm_crc32(data,data_len)!=0) + if(de_cook(data,data_len)!=0) { - mylog(log_debug,"cook_rm_crc32 check error"); + mylog(log_debug,"de_cook error"); continue; } diff --git a/packet.cpp b/packet.cpp index 655ab08..bbe10eb 100644 --- a/packet.cpp +++ b/packet.cpp @@ -301,7 +301,7 @@ int put_crc32(char * s,int &len) return 0; } -int cook_rm_crc32(char * s,int &len) +int de_cook(char * s,int &len) { if(!disable_xor)decrypt_0(s,len,key_string); if(!disable_obscure) @@ -313,7 +313,13 @@ int cook_rm_crc32(char * s,int &len) return ret; } } - return rm_crc32(s,len); + int ret=rm_crc32(s,len); + if(ret!=0) + { + mylog(log_debug,"rm_crc32 fail\n"); + return ret; + } + return 0; } int rm_crc32(char * s,int &len) { diff --git a/packet.h b/packet.h index 4f98d80..e674ad9 100644 --- a/packet.h +++ b/packet.h @@ -41,5 +41,5 @@ int put_conv(u32_t conv,const char * input,int len_in,char *&output,int &len_out int get_conv(u32_t &conv,const char *input,int len_in,char *&output,int &len_out ); int put_crc32(char * s,int &len); int rm_crc32(char * s,int &len); -int cook_rm_crc32(char * s,int &len); +int de_cook(char * s,int &len); #endif /* PACKET_H_ */