summaryrefslogtreecommitdiff
path: root/src/tsg_send_log.cpp
diff options
context:
space:
mode:
author刘学利 <[email protected]>2022-02-10 02:46:49 +0000
committer刘学利 <[email protected]>2022-02-10 02:46:49 +0000
commitd5ef785cb97b329af964923b53ea0b2005334bc6 (patch)
tree10e7c4a7918172c0e1ae67d957fff7c54cf2090f /src/tsg_send_log.cpp
parent267cfaa09a603dca66631168e9a358d01f85317d (diff)
Feature 4 layer locationv5.5.0
Diffstat (limited to 'src/tsg_send_log.cpp')
-rw-r--r--src/tsg_send_log.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp
index 9eb814c..a7f7b32 100644
--- a/src/tsg_send_log.cpp
+++ b/src/tsg_send_log.cpp
@@ -233,16 +233,24 @@ static int set_location(struct TLD_handle_t *_handle, struct streaminfo *a_strea
char buff[1024]={0};
int buff_len=sizeof(buff);
- if(location_info!=NULL)
+ if(location_info==NULL)
{
- len+=string_cat(buff+len, buff_len-len, location_info->city_full);
- buff[len++]=',';
- len+=string_cat(buff+len, buff_len-len, location_info->province_full);
- buff[len++]=',';
- len+=string_cat(buff+len, buff_len-len, location_info->country_full);
-
- TLD_append(_handle, field_name, (void *)buff, TLD_TYPE_STRING);
+ return 0;
+ }
+
+ len+=string_cat(buff+len, buff_len-len, location_info->country_full);
+ buff[len++]='.';
+ len+=string_cat(buff+len, buff_len-len, location_info->province_full);
+ buff[len++]='.';
+ len+=string_cat(buff+len, buff_len-len, location_info->city_full);
+
+ if(location_info->subdivision_addr!=NULL)
+ {
+ buff[len++]='.';
+ len+=string_cat(buff+len, buff_len-len, location_info->subdivision_addr);
}
+
+ TLD_append(_handle, field_name, (void *)buff, TLD_TYPE_STRING);
return 1;
}