Mercurial > pidgin
diff src/proxy.c @ 2300:d2686f757d6e
[gaim-migrate @ 2310]
neat things.
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Mon, 17 Sep 2001 21:30:47 +0000 |
| parents | 0844f0bdf119 |
| children | 7973a8348d8b |
line wrap: on
line diff
--- a/src/proxy.c Mon Sep 17 19:22:21 2001 +0000 +++ b/src/proxy.c Mon Sep 17 21:30:47 2001 +0000 @@ -58,6 +58,7 @@ typedef struct _GaimIOClosure { GaimInputFunction function; + guint result; gpointer data; } GaimIOClosure; @@ -76,6 +77,9 @@ if (condition & GAIM_READ_COND) gaim_cond |= GAIM_INPUT_WRITE; + debug_printf("CLOSURE: callback for %d, fd is %d\n", + closure->result, g_io_channel_unix_get_fd(source)); + closure->function(closure->data, g_io_channel_unix_get_fd(source), gaim_cond); return TRUE; @@ -84,7 +88,6 @@ gint gaim_input_add(gint source, GaimInputCondition condition, GaimInputFunction function, gpointer data) { - guint result; GaimIOClosure *closure = g_new0(GaimIOClosure, 1); GIOChannel *channel; GIOCondition cond = 0; @@ -98,14 +101,18 @@ cond |= GAIM_WRITE_COND; channel = g_io_channel_unix_new(source); - result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond, + closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond, gaim_io_invoke, closure, gaim_io_destroy); + + debug_printf("CLOSURE: adding input watcher %d for fd %d\n", closure->result, source); + g_io_channel_unref(channel); - return result; + return closure->result; } void gaim_input_remove(gint tag) { + debug_printf("CLOSURE: removing input watcher %d\n", tag); g_source_remove(tag); }
