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.
This commit is contained in:
Wim Taymans 2018-02-26 12:36:16 +01:00
parent e2f01c5838
commit 944d205e8e
2 changed files with 9 additions and 5 deletions

View file

@ -28,6 +28,7 @@
#include <sys/file.h>
#include <spa/pod/iter.h>
#include <spa/lib/debug.h>
#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;