comparison src/proxy.h @ 14108:7a205b430d19

[gaim-migrate @ 16742] Removing the "error_cb" parameter for gaim_proxy_connect(), changing it back to how it was. As I started making changes to oscar to support canceling connection attempts, I realized that having a separate callback for errors would result in more code duplication than was needed. Originally I thought the separate callback would make things cleaner. Anyway, sorry for the noise. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 14 Aug 2006 04:43:38 +0000
parents eec0c7fd8529
children c3167a1dd817
comparison
equal deleted inserted replaced
14107:c0ee28af3ca2 14108:7a205b430d19
56 56
57 } GaimProxyInfo; 57 } GaimProxyInfo;
58 58
59 typedef struct _GaimProxyConnectInfo GaimProxyConnectInfo; 59 typedef struct _GaimProxyConnectInfo GaimProxyConnectInfo;
60 60
61 typedef void (*GaimProxyConnectFunction)(gpointer data, gint source); 61 typedef void (*GaimProxyConnectFunction)(gpointer data, gint source, const gchar *error_message);
62 typedef void (*GaimProxyErrorFunction)(gpointer dat, const gchar *error_message);
63 62
64 /** 63 /**
65 * The "hosts" parameter is a linked list containing pairs of 64 * The "hosts" parameter is a linked list containing pairs of
66 * one size_t addrlen and one struct sockaddr *addr. 65 * one size_t addrlen and one struct sockaddr *addr.
67 */ 66 */
233 * 232 *
234 * @param account The account making the connection. 233 * @param account The account making the connection.
235 * @param host The destination host. 234 * @param host The destination host.
236 * @param port The destination port. 235 * @param port The destination port.
237 * @param connect_cb The function to call when the connection is 236 * @param connect_cb The function to call when the connection is
238 * established. 237 * established. If the connection failed then
239 * @param error_cb The function to call if there is an error while 238 * fd will be -1 and error message will be set
240 * establishing the connection. 239 * to something descriptive (hopefully).
241 * @param data User-defined data. 240 * @param data User-defined data.
242 * 241 *
243 * @return NULL if there was an error, or a reference to a data 242 * @return NULL if there was an error, or a reference to a data
244 * structure that can be used to cancel the pending 243 * structure that can be used to cancel the pending
245 * connection, if needed. 244 * connection, if needed.
246 */ 245 */
247 GaimProxyConnectInfo *gaim_proxy_connect(GaimAccount *account, 246 GaimProxyConnectInfo *gaim_proxy_connect(GaimAccount *account,
248 const char *host, int port, 247 const char *host, int port,
249 GaimProxyConnectFunction connect_cb, 248 GaimProxyConnectFunction connect_cb, gpointer data);
250 GaimProxyErrorFunction error_cb, gpointer data);
251 249
252 /** 250 /**
253 * Makes a connection through a SOCKS5 proxy. 251 * Makes a connection through a SOCKS5 proxy.
254 * 252 *
255 * @param gpi The GaimProxyInfo specifying the proxy settings 253 * @param gpi The GaimProxyInfo specifying the proxy settings
256 * @param host The destination host. 254 * @param host The destination host.
257 * @param port The destination port. 255 * @param port The destination port.
258 * @param connect_cb The function to call when the connection is 256 * @param connect_cb The function to call when the connection is
259 * established. 257 * established. If the connection failed then
260 * @param error_cb The function to call if there is an error while 258 * fd will be -1 and error message will be set
261 * establishing the connection. 259 * to something descriptive (hopefully).
262 * @param data User-defined data. 260 * @param data User-defined data.
263 * 261 *
264 * @return NULL if there was an error, or a reference to a data 262 * @return NULL if there was an error, or a reference to a data
265 * structure that can be used to cancel the pending 263 * structure that can be used to cancel the pending
266 * connection, if needed. 264 * connection, if needed.
267 */ 265 */
268 GaimProxyConnectInfo *gaim_proxy_connect_socks5(GaimProxyInfo *gpi, 266 GaimProxyConnectInfo *gaim_proxy_connect_socks5(GaimProxyInfo *gpi,
269 const char *host, int port, 267 const char *host, int port,
270 GaimProxyConnectFunction connect_cb, 268 GaimProxyConnectFunction connect_cb, gpointer data);
271 GaimProxyErrorFunction error_cb, gpointer data);
272 269
273 /** 270 /**
274 * Cancel an in-progress connection attempt. This should be called 271 * Cancel an in-progress connection attempt. This should be called
275 * by the PRPL if the user disables an account while it is still 272 * by the PRPL if the user disables an account while it is still
276 * performing the initial sign on. Or when establishing a file 273 * performing the initial sign on. Or when establishing a file