changeset 9729:f44ae9331afc

[gaim-migrate @ 10590] Use opt_debug less in proxy.c committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 08 Aug 2004 19:01:42 +0000
parents 8be2c406a1f1
children c9ac1976ef01
files src/proxy.c
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/proxy.c	Sun Aug 08 18:39:27 2004 +0000
+++ b/src/proxy.c	Sun Aug 08 19:01:42 2004 +0000
@@ -36,9 +36,9 @@
 #include "proxy.h"
 #include "util.h"
 
-static GaimProxyInfo *global_proxy_info = NULL;
+#include "gaim.h"
 
-static int opt_debug = 0;
+static GaimProxyInfo *global_proxy_info = NULL;
 
 struct PHB {
 	GaimInputFunction func;
@@ -418,7 +418,7 @@
 }
 
 static void
-gaim_dns_childthread(int child_out, int child_in, dns_params_t *dns_params)
+gaim_dns_childthread(int child_out, int child_in, dns_params_t *dns_params, gboolean show_debug)
 {
 	const int zero = 0;
 	int rc;
@@ -448,7 +448,7 @@
 			FD_SET(child_in, &fds);
 			rc = select(child_in + 1, &fds, NULL, NULL, &tv);
 			if (!rc) {
-				if (opt_debug)
+				if (show_debug)
 					fprintf(stderr,"dns[%d]: nobody needs me... =(\n", getpid());
 				break;
 			}
@@ -458,7 +458,7 @@
 				break;
 			}
 			if (rc==0) {
-				if(opt_debug)
+				if (show_debug)
 					fprintf(stderr,"dns[%d]: Ops, father has gone, wait for me, wait...!\n", getpid());
 				_exit(0);
 			}
@@ -481,10 +481,10 @@
 		 */
 		hints.ai_socktype = SOCK_STREAM;
 		rc = getaddrinfo(dns_params->hostname, servname, &hints, &res);
-		if(rc) {
+		if (rc) {
 			write(child_out, &rc, sizeof(int));
 			close(child_out);
-			if(opt_debug)
+			if (show_debug)
 				fprintf(stderr,"dns[%d] Error: getaddrinfo returned %d\n",
 					getpid(), rc);
 			dns_params->hostname[0] = '\0';
@@ -503,10 +503,10 @@
 #else
 		if (!inet_aton(hostname, &sin.sin_addr)) {
 			struct hostent *hp;
-			if(!(hp = gethostbyname(dns_params->hostname))) {
+			if (!(hp = gethostbyname(dns_params->hostname))) {
 				write(child_out, &h_errno, sizeof(int));
 				close(child_out);
-				if(opt_debug)
+				if (show_debug)
 					fprintf(stderr,"DNS Error: %d\n", h_errno);
 				_exit(0);
 			}
@@ -595,12 +595,12 @@
 		req->dns_pid = fork();
 
 		/* If we are the child process... */
-		if (req->dns_pid==0) {
+		if (req->dns_pid == 0) {
 			/* We should not access the parent's side of the pipe, so close them... */
 			close(child_out[0]);
 			close(child_in[1]);
 
-			gaim_dns_childthread(child_out[1], child_in[0], &dns_params);
+			gaim_dns_childthread(child_out[1], child_in[0], &dns_params, opt_debug);
 			/* The thread calls _exit() rather than returning, so we never get here */
 		}