Get TXT records on resolved callback 05/279905/1
authorCheoleun Moon <chleun.moon@samsung.com>
Wed, 23 Jun 2021 05:12:24 +0000 (14:12 +0900)
committerAnjali Nijhara <a.nijhara@samsung.com>
Thu, 18 Aug 2022 05:42:25 +0000 (11:12 +0530)
Change-Id: I88657c9ee6ca57b35b856788ef6a453fa629b40b
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
src/dns-sd/dns-sd.c

index 2448981a45bb457c02a698a198d43a94d0f48343..b02227b6582bd40b2840037db1162325643ae46e 100644 (file)
@@ -1309,7 +1309,8 @@ static int __dnssd_getaddrinfo(dnssd_handle_s *dnssd_handle, unsigned int flags,
                return DNSSD_ERROR_OUT_OF_MEMORY;
        }
 
-       DNSSD_LOGD("dnssd_handle[%p] optype[%d]", dnssd_handle, dnssd_handle->op_type);
+       DNSSD_LOGD("dnssd_handle[%p] optype[%d] if_index[%u] host[%s] name[%s] fullname[%s]",
+                       dnssd_handle, dnssd_handle->op_type, if_index, host_name, service_name, fullname);
        if (dnssd_handle->op_type == DNSSD_TYPE_BROWSE) {
                __extract_domain_from_name(fullname, &domain);
                local_handle = __create_found_service(dnssd_handle, DNSSD_TYPE_FOUND,
@@ -1319,6 +1320,10 @@ static int __dnssd_getaddrinfo(dnssd_handle_s *dnssd_handle, unsigned int flags,
                local_handle = dnssd_handle;
                dnssd_found_data_s *found = GET_FOUND_DATA_P(local_handle);
                found->port = (int)ntohs(port);
+               if (txt_record != NULL) {
+                       found->txt_record = g_strndup(txt_record, txt_len);
+                       found->txt_len = txt_len;
+               }
        } else {
                DNSSD_LOGE("Invalid op_type[%d].", dnssd_handle->op_type);
                return DNSSD_ERROR_OPERATION_FAILED;