# HG changeset patch # User Daniel Atallah # Date 1181082606 0 # Node ID bbe9248337eaac0758cce05feda1153729ed8c58 # Parent 9ccec98b8ca926d39eba7dcfa7831334c9b451a7 Fix network byte order issues with win32 bonjour stuff. Also copy the buddy's ip address so that subsequent calls don't overwrite it (it already is being copied and freed because of the howl implementation). diff -r 9ccec98b8ca9 -r bbe9248337ea libpurple/protocols/bonjour/mdns_win32.c --- a/libpurple/protocols/bonjour/mdns_win32.c Tue Jun 05 22:27:07 2007 +0000 +++ b/libpurple/protocols/bonjour/mdns_win32.c Tue Jun 05 22:30:06 2007 +0000 @@ -72,7 +72,7 @@ struct sockaddr_in *addr = (struct sockaddr_in*)g_slist_nth_data(hosts, 1); BonjourBuddy* buddy = args->buddy; - buddy->ip = inet_ntoa(addr->sin_addr); + buddy->ip = g_strdup(inet_ntoa(addr->sin_addr)); /* finally, set up the continuous txt record watcher, and add the buddy to purple */ @@ -116,7 +116,7 @@ } else { - args->buddy->port_p2pj = port; + args->buddy->port_p2pj = ntohs(port); /* parse the text record */ _mdns_parse_text_record(args->buddy, txtRecord, txtLen); @@ -262,7 +262,7 @@ { case PUBLISH_START: err = DNSServiceRegister(&data->advertisement, 0, 0, purple_account_get_username(data->account), ICHAT_SERVICE, - NULL, NULL, data->port_p2pj, TXTRecordGetLength(&dns_data), TXTRecordGetBytesPtr(&dns_data), + NULL, NULL, htons(data->port_p2pj), TXTRecordGetLength(&dns_data), TXTRecordGetBytesPtr(&dns_data), _mdns_service_register_callback, NULL); break;