summaryrefslogtreecommitdiff
path: root/capture_sync.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2006-03-09 22:13:51 +0000
committerUlf Lamping <ulf.lamping@web.de>2006-03-09 22:13:51 +0000
commit209af8f5f09ec8c440f2d6f3a3d77053ae17bb13 (patch)
treea8185b356ee65bb810e4f68a366adce0383197b8 /capture_sync.c
parentecc7e43f2c42ed803e910984b1092819206a333e (diff)
downloadwireshark-209af8f5f09ec8c440f2d6f3a3d77053ae17bb13.tar.gz
debugging helper: if (for whatever reason) the message from dumpcap was invalid, try to print it. This was already helpful e.g. as a GLib warning was confusing the pipe handling
svn path=/trunk/; revision=17559
Diffstat (limited to 'capture_sync.c')
-rw-r--r--capture_sync.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/capture_sync.c b/capture_sync.c
index 54fb3312a6..39bf34f18f 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -265,6 +265,11 @@ pipe_read_block(int pipe, char *indicator, int len, char *msg) {
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
"read %d length error, required %d > len %d, indicator: %u",
pipe, required, len, *indicator);
+
+ /* we have a problem here, try to read some more bytes from the pipe to debug where the problem really is */
+ memcpy(msg, header, sizeof(header));
+ newly = read(pipe, &msg[sizeof(header)], len-sizeof(header));
+ g_warning("Unknown message from dumpcap, try to show it as a string: %s", msg);
return -1;
}
len = required;