@@ -452,10 +452,7 @@ static int send_listener_list(struct mux_client *client, uint32_t tag)
452452 plist_dict_set_item (l , "Blacklisted" , plist_new_bool (0 ));
453453 n = NULL ;
454454 if (lc -> info ) {
455- n = plist_dict_get_item (lc -> info , "BundleID" );
456- }
457- if (n ) {
458- plist_dict_set_item (l , "BundleID" , plist_copy (n ));
455+ plist_dict_copy_item (item , lc -> info , "BundleID" , NULL );
459456 }
460457 plist_dict_set_item (l , "ConnType" , plist_new_uint (0 ));
461458
@@ -632,28 +629,11 @@ static char* plist_dict_get_string_val(plist_t dict, const char* key)
632629
633630static void update_client_info (struct mux_client * client , plist_t dict )
634631{
635- plist_t node = NULL ;
636632 plist_t info = plist_new_dict ();
637-
638- node = plist_dict_get_item (dict , "BundleID" );
639- if (node && (plist_get_node_type (node ) == PLIST_STRING )) {
640- plist_dict_set_item (info , "BundleID" , plist_copy (node ));
641- }
642-
643- node = plist_dict_get_item (dict , "ClientVersionString" );
644- if (node && (plist_get_node_type (node ) == PLIST_STRING )) {
645- plist_dict_set_item (info , "ClientVersionString" , plist_copy (node ));
646- }
647-
648- node = plist_dict_get_item (dict , "ProgName" );
649- if (node && (plist_get_node_type (node ) == PLIST_STRING )) {
650- plist_dict_set_item (info , "ProgName" , plist_copy (node ));
651- }
652-
653- node = plist_dict_get_item (dict , "kLibUSBMuxVersion" );
654- if (node && (plist_get_node_type (node ) == PLIST_UINT )) {
655- plist_dict_set_item (info , "kLibUSBMuxVersion" , plist_copy (node ));
656- }
633+ plist_dict_copy_item (info , dict , "BundleID" , NULL );
634+ plist_dict_copy_item (info , dict , "ClientVersionString" , NULL );
635+ plist_dict_copy_item (info , dict , "ProgName" , NULL );
636+ plist_dict_copy_item (info , dict , "kLibUSBMuxVersion" , NULL );
657637 plist_free (client -> info );
658638 client -> info = info ;
659639}
0 commit comments