From 944d205e8e94ee35e8554979ad53883d9c32b1cb Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 26 Feb 2018 12:36:16 +0100 Subject: [PATCH] protocol-native: print connection info after remap Print the connection messages after mapping the ids or else we can't really make sense of the ids. --- src/modules/module-protocol-native.c | 9 +++++++++ src/modules/module-protocol-native/connection.c | 5 ----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/modules/module-protocol-native.c b/src/modules/module-protocol-native.c index a93a2b4d6..d58d7cfba 100644 --- a/src/modules/module-protocol-native.c +++ b/src/modules/module-protocol-native.c @@ -28,6 +28,7 @@ #include #include +#include #include "config.h" @@ -53,6 +54,8 @@ #define UNIX_PATH_MAX 108 #endif +static bool debug_messages = 0; + #define LOCK_SUFFIX ".lock" #define LOCK_SUFFIXLEN 5 @@ -222,6 +225,10 @@ process_messages(struct client_data *data) if (!pod_remap_data(SPA_POD_TYPE_STRUCT, message, size, &client->types)) goto invalid_message; + if (debug_messages) { + printf("<<<<<<<<< in: %d %d %d\n", id, opcode, size); + spa_debug_pod((struct spa_pod *)message, 0); + } if (demarshal[opcode].func(resource, message, size) < 0) goto invalid_message; } @@ -885,6 +892,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie if (this == NULL) return -ENOMEM; + debug_messages = pw_debug_is_category_enabled("connection"); + this->implementation = &protocol_impl; this->extension = &protocol_ext_impl; diff --git a/src/modules/module-protocol-native/connection.c b/src/modules/module-protocol-native/connection.c index c7ed8dbe9..881669735 100644 --- a/src/modules/module-protocol-native/connection.c +++ b/src/modules/module-protocol-native/connection.c @@ -326,11 +326,6 @@ pw_protocol_native_connection_get_next(struct pw_protocol_native_connection *con *dt = buf->data; *sz = buf->size; - if (debug_messages) { - printf("<<<<<<<<< in: %d %d %zd\n", *dest_id, *opcode, len); - spa_debug_pod((struct spa_pod *)data, 0); - } - return true; }