comparison 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
comparison
equal deleted inserted replaced
1867:b508cbbe9c48 1868:a49ed23b3c02
67 gdk_input_remove(phb->inpa); 67 gdk_input_remove(phb->inpa);
68 phb->func(phb->data, source, GDK_INPUT_READ); 68 phb->func(phb->data, source, GDK_INPUT_READ);
69 g_free(phb); 69 g_free(phb);
70 } 70 }
71 71
72 static gboolean clean_connect(gpointer data)
73 {
74 struct PHB *phb = data;
75
76 phb->func(phb->data, phb->port, GDK_INPUT_READ);
77 g_free(phb);
78
79 return FALSE;
80 }
81
82
72 static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb) 83 static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb)
73 { 84 {
74 struct sockaddr_in sin; 85 struct sockaddr_in sin;
75 struct hostent *hp; 86 struct hostent *hp;
76 int fd = -1; 87 int fd = -1;
110 close(fd); 121 close(fd);
111 g_free(phb); 122 g_free(phb);
112 return -1; 123 return -1;
113 } 124 }
114 fcntl(fd, F_SETFL, 0); 125 fcntl(fd, F_SETFL, 0);
115 phb->func(phb->data, fd, GDK_INPUT_READ); 126 phb->port = fd; /* bleh */
116 g_free(phb); 127 gtk_timeout_add(50, clean_connect, phb); /* we do this because we never
128 want to call our callback
129 before we return. */
117 } 130 }
118 131
119 return fd; 132 return fd;
120 } 133 }
121 134