comparison src/proxy.c @ 2096:39b4413ce4b3

[gaim-migrate @ 2106] leek soup committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 01 Aug 2001 06:36:37 +0000
parents b66aca8e8dce
children b5ad79ad917b
comparison
equal deleted inserted replaced
2095:df9710306152 2096:39b4413ce4b3
59 typedef struct _GaimIOClosure { 59 typedef struct _GaimIOClosure {
60 GaimInputFunction function; 60 GaimInputFunction function;
61 gpointer data; 61 gpointer data;
62 } GaimIOClosure; 62 } GaimIOClosure;
63 63
64 static void gaim_io_destroy(gpointer data)
65 {
66 g_free(data);
67 }
68
64 static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data) 69 static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data)
65 { 70 {
66 GaimIOClosure *closure = data; 71 GaimIOClosure *closure = data;
67 GaimInputCondition gaim_cond = 0; 72 GaimInputCondition gaim_cond = 0;
68 73
91 cond |= GAIM_READ_COND; 96 cond |= GAIM_READ_COND;
92 if (condition & GAIM_INPUT_WRITE) 97 if (condition & GAIM_INPUT_WRITE)
93 cond |= GAIM_WRITE_COND; 98 cond |= GAIM_WRITE_COND;
94 99
95 channel = g_io_channel_unix_new(source); 100 channel = g_io_channel_unix_new(source);
96 result = g_io_add_watch(channel, cond, gaim_io_invoke, closure); 101 result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond,
102 gaim_io_invoke, closure, gaim_io_destroy);
97 g_io_channel_unref(channel); 103 g_io_channel_unref(channel);
98 return result; 104 return result;
99 } 105 }
100 106
101 void gaim_input_remove(gint tag) 107 void gaim_input_remove(gint tag)