diff options
| author | liuxueli <[email protected]> | 2021-09-26 11:20:34 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2021-09-26 11:20:34 +0800 |
| commit | b531617b28cddad3d194091e0de2f92541be44a9 (patch) | |
| tree | 843754ead3c4cc6141f8c6e3c93e8a81aac5baae | |
| parent | 69b19d254564f0daeb84cbf4f529d05bc1bfd6d4 (diff) | |
TSG-7908: FS2报错但不影响功能v2.9.12
| -rw-r--r-- | src/MESA_field_stat.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/MESA_field_stat.cpp b/src/MESA_field_stat.cpp index 0228ce1..fd5034c 100644 --- a/src/MESA_field_stat.cpp +++ b/src/MESA_field_stat.cpp @@ -152,12 +152,16 @@ static int send_udp(int sd, unsigned int dest_ip, unsigned short dest_port, cons } void flush_metric(struct FS_space_t* _handle) { - if(_handle->snd_buf_off==0 || _handle->server_port==0) + if(_handle->snd_buf_off==0) { return; } - send_udp(_handle->statsd_socket, _handle->server_ip,(unsigned short) _handle->server_port, - _handle->send_buff, _handle->snd_buf_off); + + if(_handle->server_port>0) + { + send_udp(_handle->statsd_socket, _handle->server_ip,(unsigned short) _handle->server_port, _handle->send_buff, _handle->snd_buf_off); + } + _handle->snd_buf_off=0; memset(_handle->send_buff,0,sizeof(_handle->send_buff)); return; |
