libpurple/protocols/bonjour/mdns_win32.c

changeset 17613
1a64916f979a
parent 17612
72b49b54ee39
child 17659
c919e9ee132f
--- 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;
 

mercurial