diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-10-06 00:55:21 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-10-06 00:55:21 +0000 |
commit | bb5e5d6ce10fe015e1c7aabcca8c51d097b5c789 (patch) | |
tree | 433f89941372c48953ab394a1dda36da8b645606 /gtk/gui_utils.c | |
parent | 70d49795575878ccb1f4a48536243866ba6a61ef (diff) |
fix a packet_list_freeze / thaw pair, if a return comes in it's way
add a g_warning() call if an error occured while reading from capture file (while doing a live update), usually shouldn't happen but is difficult to debug *if* it happens
add a new log domain LOG_DOMAIN_MAIN and the standard log handler for it
add some (partly commented out) g_log() calls, useful for GUI sequence debugging
svn path=/trunk/; revision=16136
Diffstat (limited to 'gtk/gui_utils.c')
-rw-r--r-- | gtk/gui_utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gui_utils.c b/gtk/gui_utils.c index c42e9fbf21..725dcfcb08 100644 --- a/gtk/gui_utils.c +++ b/gtk/gui_utils.c @@ -637,6 +637,8 @@ pipe_timer_cb(gpointer data) /* try to read data from the pipe only 5 times, to avoid blocking */ while(iterations < 5) { + /*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: new iteration");*/ + /* Oddly enough although Named pipes don't work on win9x, PeekNamedPipe does !!! */ handle = (HANDLE) _get_osfhandle (pipe_input->source); @@ -651,7 +653,10 @@ pipe_timer_cb(gpointer data) callback */ if (!result || avail > 0 || childstatus != STILL_ACTIVE) { + /*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: data avail");*/ + if(pipe_input->pipe_input_id != 0) { + /*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: stop timer");*/ /* avoid reentrancy problems and stack overflow */ gtk_timeout_remove(pipe_input->pipe_input_id); pipe_input->pipe_input_id = 0; @@ -659,11 +664,13 @@ pipe_timer_cb(gpointer data) /* And call the real handler */ if (!pipe_input->input_cb(pipe_input->source, pipe_input->user_data)) { + g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: input pipe closed, iterations: %u", iterations); /* pipe closed, return false so that the old timer is not run again */ return FALSE; } } else { + /*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: no data avail");*/ /* No data, stop now */ break; } @@ -674,10 +681,13 @@ pipe_timer_cb(gpointer data) if(pipe_input->pipe_input_id == 0) { /* restore pipe handler */ pipe_input->pipe_input_id = gtk_timeout_add(200, pipe_timer_cb, data); + /*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: finished with iterations: %u, new timer", iterations);*/ /* Return false so that the old timer is not run again */ return FALSE; } else { + /*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: finished with iterations: %u, old timer", iterations);*/ + /* we didn't stopped the old timer, so let it run */ return TRUE; } @@ -725,6 +735,7 @@ void pipe_input_set_handler(gint source, gpointer user_data, int *child_process, this but doesn't seem to work over processes. Attempt to do something similar here, start a timer and check for data on every timeout. */ + /*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_input_set_handler: new");*/ pipe_input.pipe_input_id = gtk_timeout_add(200, pipe_timer_cb, &pipe_input); #else pipe_input.pipe_input_id = gtk_input_add_full(source, |