pidgin: a2330b79: Currently when a child dns resolver proc...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Sep 10 18:05:54 EDT 2008


-----------------------------------------------------------------
Revision: a2330b7944094a31f5d9b60e6bd02a2ae913497b
Ancestor: 7bbe14843cc0f5cc89746d07c3331b91bfa5edf5
Author: markdoliner at pidgin.im
Date: 2008-09-10T21:32:50
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a2330b7944094a31f5d9b60e6bd02a2ae913497b

Modified files:
        libpurple/dnsquery.c

ChangeLog: 

Currently when a child dns resolver process reads a domain name from
the parent, the child sends the letter 'Y' to the parent to let it
know that it received the request.  I don't see how we would gain
anything from this, and I don't see how it would help avoid any sort
of race condition (beside, we should be eliminating race conditions,
not just avoiding them), so I'm removing it.

If you think this is really needed for some reason please let me know
(or just revert it)

-------------- next part --------------
============================================================
--- libpurple/dnsquery.c	c4cf150193a2be8b58173dfb91b0dfd02d8e0576
+++ libpurple/dnsquery.c	cc8a513419aadd60d1959e4ca1e2c721945774db
@@ -209,7 +209,6 @@ purple_dnsquery_resolver_run(int child_o
 	 * the result back to our parent, when finished.
 	 */
 	while (1) {
-		const char ch = 'Y';
 		fd_set fds;
 		struct timeval tv = { .tv_sec = 40 , .tv_usec = 0 };
 		FD_ZERO(&fds);
@@ -237,8 +236,6 @@ purple_dnsquery_resolver_run(int child_o
 					dns_params.port);
 			_exit(1);
 		}
-		/* Tell our parent that we read the data successfully */
-		write_to_parent(child_out, &ch, sizeof(ch));
 
 		/* We have the hostname and port, now resolve the IP */
 
@@ -426,7 +423,6 @@ send_dns_request_to_child(PurpleDnsQuery
 	pid_t pid;
 	dns_params_t dns_params;
 	int rc;
-	char ch;
 
 	/* This waitpid might return the child's PID if it has recently
 	 * exited, or it might return an error if it exited "long
@@ -461,17 +457,6 @@ send_dns_request_to_child(PurpleDnsQuery
 
 	g_return_val_if_fail(rc == sizeof(dns_params), -1);
 
-	/* Did you hear me? (This avoids some race conditions) */
-	rc = read(resolver->fd_out, &ch, sizeof(ch));
-	if (rc != 1 || ch != 'Y')
-	{
-		purple_debug_warning("dns",
-				"DNS child %d not responding. Killing it!\n",
-				resolver->dns_pid);
-		purple_dnsquery_resolver_destroy(resolver);
-		return FALSE;
-	}
-
 	purple_debug_info("dns",
 			"Successfully sent DNS request to child %d\n",
 			resolver->dns_pid);


More information about the Commits mailing list