From 3e33da55c9953b0da82f110bfc8b28682dc3f275 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 13 Feb 2015 16:03:49 +0100 Subject: [PATCH] upnp: add debug fcn to dump output packets --- src/upnp.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/upnp.c b/src/upnp.c index 95747459..23485e5a 100644 --- a/src/upnp.c +++ b/src/upnp.c @@ -101,6 +101,20 @@ upnp_send( htsbuf_queue_t *q, struct sockaddr_storage *storage, int delay_ms ) pthread_mutex_unlock(&upnp_lock); } +/* + * + */ +static void +upnp_dump_data( upnp_data_t *data ) +{ +#if 0 + char tbuf[256]; + inet_ntop(data->storage.ss_family, IP_IN_ADDR(data->storage), tbuf, sizeof(tbuf)); + printf("upnp out to %s:%d\n", tbuf, ntohs(IP_PORT(data->storage))); + htsbuf_hexdump(&data->queue, "upnp out"); +#endif +} + /* * Discovery thread */ @@ -183,6 +197,7 @@ upnp_thread( void *aux ) pthread_mutex_unlock(&upnp_lock); if (data == NULL) break; + upnp_dump_data(data); udp_write_queue(unicast, &data->queue, &data->storage); htsbuf_queue_flush(&data->queue); free(data); @@ -200,6 +215,7 @@ upnp_thread( void *aux ) if (data == NULL) break; usleep((long)data->delay_ms * 1000); + upnp_dump_data(data); udp_write_queue(unicast, &data->queue, &data->storage); htsbuf_queue_flush(&data->queue); free(data);