changeset 25036:3c3480683075

* fixing some bugs, finishing support for TXT queries
author Tobias Markmann <tfar@soc.pidgin.im>
date Fri, 01 Aug 2008 22:37:51 +0000
parents affaa4c4836e
children 94c8bef52c66
files libpurple/dnssrv.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dnssrv.c	Fri Aug 01 12:34:33 2008 +0000
+++ b/libpurple/dnssrv.c	Fri Aug 01 22:37:51 2008 +0000
@@ -198,7 +198,7 @@
 end:
 	size = g_list_length(ret);
 	write(out, &(query.type), sizeof(query.type));
-	write(out, &size, sizeof(int));
+	write(out, &size, sizeof(size));
 	while (ret != NULL)
 	{
 		if (query.type == T_SRV) write(out, ret->data, sizeof(PurpleSrvResponse));
@@ -223,7 +223,6 @@
 	int status;
 	
 	if (read(source, &type, sizeof(type)) == sizeof(type)) {
-		purple_debug_info("dnssrv","type: %d\n", type);
 		if (type == T_SRV) {
 			PurpleSrvResponse *res;
 			PurpleSrvResponse *tmp;
@@ -511,6 +510,7 @@
 {
 	char *query;
 	PurpleSrvQueryData *query_data;
+	PurpleSrvInternalQuery internal_query;
 #ifndef _WIN32
 	int in[2], out[2];
 	int pid;
@@ -552,7 +552,10 @@
 	close(out[1]);
 	close(in[0]);
 	
-	if (write(in[1], query, strlen(query)+1) < 0)
+	internal_query.type = T_TXT;
+	strncpy(internal_query.query, query, 255);
+	
+	if (write(in[1], &internal_query, sizeof(internal_query)) < 0)
 		purple_debug_error("dnssrv", "Could not write to TXT resolver\n");
 
 	query_data = g_new0(PurpleSrvQueryData, 1);