diff src/proxy.c @ 1868:a49ed23b3c02

[gaim-migrate @ 1878] proxy stuff. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 20 May 2001 12:06:06 +0000
parents 9845deede1e9
children a02584b98823
line wrap: on
line diff
--- a/src/proxy.c	Sun May 20 10:39:10 2001 +0000
+++ b/src/proxy.c	Sun May 20 12:06:06 2001 +0000
@@ -69,6 +69,17 @@
 	g_free(phb);
 }
 
+static gboolean clean_connect(gpointer data)
+{
+	struct PHB *phb = data;
+
+	phb->func(phb->data, phb->port, GDK_INPUT_READ);
+	g_free(phb);
+
+	return FALSE;
+}
+
+
 static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb)
 {
 	struct sockaddr_in sin;
@@ -112,8 +123,10 @@
 			return -1;
 		}
 		fcntl(fd, F_SETFL, 0);
-		phb->func(phb->data, fd, GDK_INPUT_READ);
-		g_free(phb);
+		phb->port = fd; /* bleh */
+		gtk_timeout_add(50, clean_connect, phb); /* we do this because we never
+							    want to call our callback
+							    before we return. */
 	}
 
 	return fd;